--- a/.hgignore Mon Feb 21 09:02:09 2011 -0800
+++ b/.hgignore Wed Feb 23 15:57:37 2011 -0800
@@ -58,6 +58,8 @@
^usr/src/cmd/gui-install/src/gui-install$
^usr/src/cmd/install-tools/ManifestRead$
^usr/src/cmd/install-tools/ManifestServ$
+^usr/src/cmd/installadm/create-service
+^usr/src/cmd/installadm/i386/create-service
^usr/src/cmd/installadm/check-server-setup$
^usr/src/cmd/installadm.*installadm$
^usr/src/cmd/installadm/installadm-common$
--- a/usr/src/cmd/auto-install/svc/manifest-locator Mon Feb 21 09:02:09 2011 -0800
+++ b/usr/src/cmd/auto-install/svc/manifest-locator Wed Feb 23 15:57:37 2011 -0800
@@ -20,7 +20,7 @@
# CDDL HEADER END
#
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Use tee(1) when posting messages to both console and log file
@@ -158,9 +158,9 @@
return 1
fi
- print "Service located at $AI_SERVICE_ADDRESS will be used" | \
- $TEE_LOGTOCONSOLE
- print "$AI_SERVICE_ADDRESS" > $AI_SERVICE_LIST
+ print "Service $AI_SERVICE_NAME located at $AI_SERVICE_ADDRESS" \
+ "will be used" | $TEE_LOGTOCONSOLE
+ print "$AI_SERVICE_ADDRESS:$AI_SERVICE_NAME" > $AI_SERVICE_LIST
fi
print "Service discovery finished successfully" | $TEE_LOGTOCONSOLE
--- a/usr/src/cmd/installadm/aimdns_mod.py Mon Feb 21 09:02:09 2011 -0800
+++ b/usr/src/cmd/installadm/aimdns_mod.py Wed Feb 23 15:57:37 2011 -0800
@@ -200,10 +200,10 @@
self.sdrefs = {}
self.interfaces = libaimdns.getifaddrs()
- self.exclude = libaimdns.getboolean_property(common.SRVINST,
- common.EXCLPROP)
- self.networks = libaimdns.getstrings_property(common.SRVINST,
- common.NETSPROP)
+
+ self.register_initialized = False
+ self.exclude = False
+ self.networks = ['0.0.0.0/0']
self.instance = None
self.instance_services = None
@@ -408,7 +408,7 @@
# retrieved per interface configured
if self._do_lookup is True:
count += 1
- if count == self.count:
+ if count >= self.count:
self.done = True
# <CTL>-C will exit the loop, application
@@ -474,6 +474,13 @@
if SMF txt_record property does not exist, OR
if SMF port property does not exist.
'''
+ if not self.register_initialized:
+ self.exclude = libaimdns.getboolean_property(common.SRVINST,
+ common.EXCLPROP)
+ self.networks = libaimdns.getstrings_property(common.SRVINST,
+ common.NETSPROP)
+ self.register_initialized = True
+
smf_port = None
# if port is 0 then processing an AI service
if port is 0:
@@ -792,18 +799,23 @@
# figure out how many possible services, so that we have an idea
# how many times to process the browse requests
self.count = 0
- inst = smf.AISCF(FMRI="system/install/server")
- for service in inst.services.keys():
- service_instance = smf.AIservice(inst, service)
- if 'status' in service_instance.keys():
- self.count += 1
+ try:
+ inst = smf.AISCF(FMRI="system/install/server")
+ for service in inst.services.keys():
+ service_instance = smf.AIservice(inst, service)
+ if 'status' in service_instance.keys():
+ self.count += 1
+ except SystemError:
+ pass
interface_count = 0
for inf in self.interfaces:
in_net = in_networks(self.interfaces[inf], self.networks)
if (in_net and not self.exclude) or (not in_net and self.exclude):
interface_count += 1
- self.count *= interface_count
+
+ if interface_count:
+ self.count *= interface_count
if self.verbose:
print _('Browsing for services...')
@@ -854,6 +866,7 @@
in_net = in_networks(self.interfaces[inf], self.networks)
if (in_net and not self.exclude) or (not in_net and self.exclude):
self.count += 1
+
# register the service on the appropriate interface index
try:
interfaceindex = netif.if_nametoindex(inf)