diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_chef.py | 2 | ||||
-rw-r--r-- | cloudinit/config/cc_rh_subscription.py | 14 | ||||
-rw-r--r-- | cloudinit/net/__init__.py | 3 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceCloudSigma.py | 2 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceNoCloud.py | 7 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 2 |
6 files changed, 22 insertions, 8 deletions
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py index 6ecaf8db..4c28be6a 100644 --- a/cloudinit/config/cc_chef.py +++ b/cloudinit/config/cc_chef.py @@ -213,7 +213,7 @@ def handle(name, cfg, cloud, log, _args): if vcert != "system": util.write_file(vkey_path, vcert) elif not os.path.isfile(vkey_path): - log.warn("chef validation_cert provided as 'system', but " + log.warn("chef validation_cert provided as 'system', but " "validation_key path '%s' does not exist.", vkey_path) diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py index 6087c45c..3a113aea 100644 --- a/cloudinit/config/cc_rh_subscription.py +++ b/cloudinit/config/cc_rh_subscription.py @@ -19,10 +19,14 @@ from cloudinit import util -def handle(_name, cfg, _cloud, log, _args): +def handle(name, cfg, _cloud, log, _args): sm = SubscriptionManager(cfg) sm.log = log - if not sm.is_registered: + if not sm.is_configured(): + log.debug("%s: module not configured.", name) + return None + + if not sm.is_registered(): try: verify, verify_msg = sm._verify_keys() if verify is not True: @@ -95,7 +99,6 @@ class SubscriptionManager(object): self.disable_repo = self.rhel_cfg.get('disable-repo') self.servicelevel = self.rhel_cfg.get('service-level') self.subman = ['subscription-manager'] - self.is_registered = self._is_registered() def log_success(self, msg): '''Simple wrapper for logging info messages. Useful for unittests''' @@ -134,7 +137,7 @@ class SubscriptionManager(object): return False, no_auto return True, None - def _is_registered(self): + def is_registered(self): ''' Checks if the system is already registered and returns True if so, else False @@ -400,3 +403,6 @@ class SubscriptionManager(object): self.log.debug("Disabled the following repos: %s" % (", ".join(disable_list)).replace('--disable=', '')) return True + + def is_configured(self): + return bool((self.userid and self.password) or self.activation_key) diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index 40929c6e..31110292 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -646,6 +646,9 @@ def generate_fallback_config(): connected = [] possibly_connected = [] for interface in potential_interfaces: + if os.path.exists(sys_dev_path(interface, "bridge")): + # skip any bridges + continue try: carrier = int(sys_netdev_info(interface, 'carrier')) if carrier: diff --git a/cloudinit/sources/DataSourceCloudSigma.py b/cloudinit/sources/DataSourceCloudSigma.py index f8f94759..d7d4e844 100644 --- a/cloudinit/sources/DataSourceCloudSigma.py +++ b/cloudinit/sources/DataSourceCloudSigma.py @@ -56,7 +56,7 @@ class DataSourceCloudSigma(sources.DataSource): LOG.debug("determining hypervisor product name via dmi data") sys_product_name = util.read_dmi_data("system-product-name") if not sys_product_name: - LOG.warn("failed to get hypervisor product name via dmi data") + LOG.debug("system-product-name not available in dmi data") return False else: LOG.debug("detected hypervisor as %s", sys_product_name) diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py index c2fba4d2..74d0e5ec 100644 --- a/cloudinit/sources/DataSourceNoCloud.py +++ b/cloudinit/sources/DataSourceNoCloud.py @@ -216,8 +216,11 @@ class DataSourceNoCloud(sources.DataSource): if not current: return None + # LP: #1568150 need getattr in the case that an old class object + # has been loaded from a pickled file and now executing new source. + dirs = getattr(self, 'seed_dirs', [self.seed_dir]) quick_id = _quick_read_instance_id(cmdline_id=self.cmdline_id, - dirs=self.seed_dirs) + dirs=dirs) if not quick_id: return None return quick_id == current @@ -238,6 +241,8 @@ def _quick_read_instance_id(cmdline_id, dirs=None): return fill[iid_key] for d in dirs: + if d is None: + continue try: data = util.pathprefix2dict(d, required=['meta-data']) md = util.load_yaml(data['meta-data']) diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index 5edab152..6cbd8dfa 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -242,7 +242,7 @@ class DataSourceSmartOS(sources.DataSource): # SDC KVM instances will provide dmi data, LX-brand does not if self.smartos_type == 'kvm': dmi_info = dmi_data() - if dmi_info is False: + if dmi_info is None: LOG.debug("No dmidata utility found") return False |