Created
February 16, 2012 23:27
-
-
Save bdha/1848735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /root/sdc-dsimport openbsd-5.0-gateway.dsmanifest | |
| Importing Dataset defined in 'openbsd-5.0-gateway.dsmanifest'. | |
| Checking dataset file '/var/tmp/openbsd-5.0-gateway.zvol.bz2' sha1. | |
| Copy dataset file to datasets dir, '/usbkey/datasets/openbsd-5.0-gateway.zvol.bz2'. | |
| Registering dataset b5de0960-592f-11e1-8536-a7811176bc79 (sdc:admin:openbsd-5.0-gateway:1.0) with MAPI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # diff -u /smartdc/bin/sdc-dsimport sdc-dsimport | |
| --- /smartdc/bin/sdc-dsimport Thu Jan 26 16:05:13 2012 | |
| +++ sdc-dsimport Fri Feb 17 06:19:32 2012 | |
| @@ -45,14 +45,15 @@ | |
| dsapi=$2 | |
| if [[ -z "${dsapi}" ]]; then | |
| dsapi=${CONFIG_dsapi_url} | |
| + # Need an IP for datasets hostname. | |
| + local dsapi_ip=${dsapi} | |
| + hostname=$(echo ${dsapi} | cut -f3 -d "/" | cut -f1 -d ":") | |
| + | |
| + #if [[ ! `echo "${hostname}" | grep "^[0-9\.]*$" 2>&1` ]]; then | |
| + # ip=$(dig $hostname +short) | |
| + # dsapi_ip=$(echo $dsapi | sed "s|\(.*\)$hostname\(.*\)|\1$ip\2|") | |
| + #fi | |
| fi | |
| - # Need an IP for datasets hostname. | |
| - local dsapi_ip=${dsapi} | |
| - hostname=$(echo ${dsapi} | cut -f3 -d "/" | cut -f1 -d ":") | |
| - if [[ ! `echo "${hostname}" | grep "^[0-9\.]*$" 2>&1` ]]; then | |
| - ip=$(dig $hostname +short) | |
| - dsapi_ip=$(echo $dsapi | sed "s|\(.*\)$hostname\(.*\)|\1$ip\2|") | |
| - fi | |
| # Note: /usr/bin/egrep on smartos doesn't support '{m,n}' quantifiers. | |
| # /usr/xpg4/bin/egrep *does*, so should switch to that. | |
| @@ -68,7 +69,7 @@ | |
| fatal "'${dataset_arg}' isn't a Dataset UUID and isn't an existing .dsmanifest file. Aborting." | |
| fi | |
| - local manifest; | |
| + local manifest | |
| if [[ "${mode}" == "dsapi" ]]; then | |
| echo "Getting dataset info from Dataset API (${dsapi}))." | |
| manifest=$(DSAPI_URL=${dsapi_ip} sdc-dsapi /datasets/$dataset_uuid | json -H) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the patch commited to our master (slight corrections to my previously posted patch after actually testing it):