exclude modules fix 1

This commit is contained in:
Nate House nathan.house@rackspace.com 2014-01-28 08:48:47 -06:00
parent 721ba62bf3
commit 9d3990ee82
14 changed files with 14 additions and 27 deletions

View File

@ -40,8 +40,7 @@ def handle(_name, cfg, cloud, log, _args):
See doc/examples/cloud-config_disk-setup.txt for documentation on the
format.
"""
if cloud.is_excluded(_name):
return
disk_setup = cfg.get("disk_setup")
if isinstance(disk_setup, dict):
update_disk_setup_devices(disk_setup, cloud.device_name_to_device)

View File

@ -213,8 +213,7 @@ def resize_devices(resizer, devices):
def handle(_name, cfg, _cloud, log, _args):
if _cloud.is_excluded(_name):
return
if 'growpart' not in cfg:
log.debug("No 'growpart' entry in cfg. Using default: %s" %
DEFAULT_CONFIG)

View File

@ -49,8 +49,7 @@ def _autostart_puppet(log):
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
# If there isn't a puppet key in the configuration don't do anything
if 'puppet' not in cfg:
log.debug(("Skipping module named %s,"

View File

@ -39,8 +39,7 @@ def _decode(data, encoding=None):
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
if not cfg or "random_seed" not in cfg:
log.debug(("Skipping module named %s, "
"no 'random_seed' configuration found"), name)

View File

@ -22,8 +22,7 @@ from cloudinit import util
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
log.debug(("Configuration option 'preserve_hostname' is set,"
" not setting the hostname in module %s"), name)

View File

@ -36,8 +36,7 @@ PW_SET = (letters.translate(None, 'loLOI') +
def handle(_name, cfg, cloud, log, args):
if cloud.is_excluded(_name):
return
if len(args) != 0:
# if run from command line, and give args, wipe the chpasswd['list']
password = args[0]

View File

@ -56,8 +56,7 @@ KEY_FILE_TPL = '/etc/ssh/ssh_host_%s_key'
def handle(_name, cfg, cloud, log, _args):
if cloud.is_excluded(_name):
return
# remove the static keys from the pristine image
if cfg.get("ssh_deletekeys", True):
key_pth = os.path.join("/etc/ssh/", "ssh_host_*key*")

View File

@ -92,8 +92,7 @@ def _pprint_key_entries(user, key_fn, key_entries, hash_meth='md5',
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
if 'no_ssh_fingerprints' in cfg:
log.debug(("Skipping module named %s, "
"logging of ssh fingerprints disabled"), name)

View File

@ -32,8 +32,7 @@ distros = ['ubuntu']
def handle(_name, cfg, cloud, log, args):
if cloud.is_excluded(_name):
return
# import for "user: XXXXX"
if len(args) != 0:
user = args[0]

View File

@ -26,8 +26,7 @@ frequency = PER_INSTANCE
def handle(name, cfg, cloud, log, args):
if cloud.is_excluded(name):
return
if len(args) != 0:
timezone = args[0]
else:

View File

@ -27,8 +27,7 @@ frequency = PER_ALWAYS
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
manage_hosts = util.get_cfg_option_str(cfg, "manage_etc_hosts", False)
if util.translate_bool(manage_hosts, addons=['template']):
(hostname, fqdn) = util.get_hostname_fqdn(cfg, cloud)

View File

@ -27,8 +27,7 @@ frequency = PER_ALWAYS
def handle(name, cfg, cloud, log, _args):
if cloud.is_excluded(name):
return
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
log.debug(("Configuration option 'preserve_hostname' is set,"
" not updating the hostname in module %s"), name)

View File

@ -27,8 +27,7 @@ frequency = PER_INSTANCE
def handle(name, cfg, cloud, _log, _args):
if cloud.is_excluded(name):
return
(users, groups) = ds.normalize_users_groups(cfg, cloud.distro)
for (name, members) in groups.items():
cloud.distro.create_group(name, members)

View File

@ -62,7 +62,7 @@ class Distro(object):
self.name = name
def is_excluded(self, name):
if name in self.excluded_modules:
if name in self.exclude_modules:
distro = getattr(self, name, None) or getattr(self, 'osfamily')
LOG.debug(("Skipping module named %s, distro excluded"), name,
distro)