7083848 installadm create-service generates confusing error messages if non-existent iso specified
--- a/usr/src/cmd/installadm/create_service.py Fri Dec 30 12:44:08 2011 -0800
+++ b/usr/src/cmd/installadm/create_service.py Tue Jan 03 11:56:20 2012 -0800
@@ -522,6 +522,12 @@
publisher=options.publisher)
except (ImageError,
pkg.client.api_errors.ApiException) as err:
+ print >> sys.stderr, cw(_("The specified data source, %s, "
+ "for the service is not a path to an existing ISO image.") % \
+ options.srcimage)
+ print >> sys.stderr, cw(_("Attempting to create the service from"
+ " pkg(5) package, %s, failed for the following reasons:") % \
+ options.srcimage)
if isinstance(err, pkg.client.api_errors.VersionException):
print >> sys.stderr, cw(_("The IPS API version specified, "
+ str(err.received_version) +
@@ -578,7 +584,7 @@
bootargs=options.bootargs)
except AIServiceError as err:
raise SystemExit(err)
-
+
# Register & enable service
# (Also enables system/install/server, as needed)
got_services_error = False
@@ -645,7 +651,7 @@
options = parse_options(cmd_options)
logging.debug('options: %s', options)
-
+
# Check the network configuration. Verify that the server settings
# are not obviously broken (i.e., check for things which will definitely
# cause failure).
@@ -670,7 +676,7 @@
modified_env['LC_NUMERIC'] = 'C'
if Popen(cmd, env=modified_env).wait():
raise SystemExit(1)
-
+
# convert options.bootargs to a string
if options.bootargs:
options.bootargs = ",".join(options.bootargs) + ","