diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-10 14:35:23 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-10 14:35:23 -0400 |
commit | b76f489dc594c352b285b0239b0ce872ccf3511d (patch) | |
tree | 5638753015b8675e53af4b6cabb3cf0d36025bc7 | |
parent | dae027b74b2b73e34e197f014e3f5220a95a7099 (diff) | |
parent | 91a5bf5fb67a147e2f434407d1449e745dc1ba3f (diff) | |
download | vyos-cloud-init-b76f489dc594c352b285b0239b0ce872ccf3511d.tar.gz vyos-cloud-init-b76f489dc594c352b285b0239b0ce872ccf3511d.zip |
merge from trunk
-rw-r--r-- | cloudinit/config/cc_set_passwords.py | 2 | ||||
-rw-r--r-- | cloudinit/config/cc_ssh_import_id.py | 2 | ||||
-rw-r--r-- | cloudinit/distros/__init__.py | 2 | ||||
-rw-r--r-- | cloudinit/distros/arch.py | 2 | ||||
-rw-r--r-- | cloudinit/distros/debian.py | 2 | ||||
-rw-r--r-- | cloudinit/distros/freebsd.py | 2 | ||||
-rw-r--r-- | cloudinit/distros/gentoo.py | 2 | ||||
-rw-r--r-- | cloudinit/sources/helpers/openstack.py | 1 | ||||
-rw-r--r-- | tests/unittests/test_data.py | 9 | ||||
-rw-r--r-- | tests/unittests/test_datasource/test_nocloud.py | 1 | ||||
-rw-r--r-- | tests/unittests/test_runs/test_merge_run.py | 2 |
11 files changed, 13 insertions, 14 deletions
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py index 24e33915..4ca85e21 100644 --- a/cloudinit/config/cc_set_passwords.py +++ b/cloudinit/config/cc_set_passwords.py @@ -132,7 +132,7 @@ def handle(_name, cfg, cloud, log, args): 'PasswordAuthentication', pw_auth)) - lines = [str(e) for e in new_lines] + lines = [str(l) for l in new_lines] util.write_file(ssh_util.DEF_SSHD_CFG, "\n".join(lines)) try: diff --git a/cloudinit/config/cc_ssh_import_id.py b/cloudinit/config/cc_ssh_import_id.py index 76c1663d..2d480d7e 100644 --- a/cloudinit/config/cc_ssh_import_id.py +++ b/cloudinit/config/cc_ssh_import_id.py @@ -85,7 +85,7 @@ def import_ssh_ids(ids, user, log): return try: - _check = pwd.getpwnam(user) + pwd.getpwnam(user) except KeyError as exc: raise exc diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 9c9211fe..2599d9f2 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -861,5 +861,5 @@ def set_etc_timezone(tz, tz_file=None, tz_conf="/etc/timezone", util.write_file(tz_conf, str(tz).rstrip() + "\n") # This ensures that the correct tz will be used for the system if tz_local and tz_file: - util.copy(tz_file, self.tz_local_fn) + util.copy(tz_file, tz_local) return diff --git a/cloudinit/distros/arch.py b/cloudinit/distros/arch.py index 9f11b89c..005a0dd4 100644 --- a/cloudinit/distros/arch.py +++ b/cloudinit/distros/arch.py @@ -159,7 +159,7 @@ class Distro(distros.Distro): return hostname def set_timezone(self, tz): - set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) + distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) def package_command(self, command, args=None, pkgs=None): if pkgs is None: diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py index 7cf4a9ef..010be67d 100644 --- a/cloudinit/distros/debian.py +++ b/cloudinit/distros/debian.py @@ -131,7 +131,7 @@ class Distro(distros.Distro): return "127.0.1.1" def set_timezone(self, tz): - set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) + distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) def package_command(self, command, args=None, pkgs=None): if pkgs is None: diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index 849834eb..cff10387 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -264,7 +264,7 @@ class Distro(distros.Distro): if 'dns-nameservers' in info: nameservers.extend(info['dns-nameservers']) if 'dns-search' in info: - searchservers.extend(info['dns-search']) + searchdomains.extend(info['dns-search']) else: ifconfig = 'DHCP' diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py index c4b02de1..45c2e658 100644 --- a/cloudinit/distros/gentoo.py +++ b/cloudinit/distros/gentoo.py @@ -138,7 +138,7 @@ class Distro(distros.Distro): return hostname def set_timezone(self, tz): - set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) + distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz)) def package_command(self, command, args=None, pkgs=None): if pkgs is None: diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py index 61c61570..7b27621c 100644 --- a/cloudinit/sources/helpers/openstack.py +++ b/cloudinit/sources/helpers/openstack.py @@ -421,6 +421,7 @@ class MetadataReader(BaseReader): if self._versions is not None: return self.os_versions found = [] + version_path = self._path_join(self.base_path, "openstack") content = self._path_read(version_path) for line in content.splitlines(): line = line.strip() diff --git a/tests/unittests/test_data.py b/tests/unittests/test_data.py index 41d0dc29..fd6bd8a1 100644 --- a/tests/unittests/test_data.py +++ b/tests/unittests/test_data.py @@ -106,7 +106,7 @@ class TestConsumeUserData(helpers.FilesystemMockingTestCase): initer.read_cfg() initer.initialize() initer.fetch() - _iid = initer.instancify() + initer.instancify() initer.update() initer.cloudify().run('consume_data', initer.consume_data, @@ -145,7 +145,7 @@ class TestConsumeUserData(helpers.FilesystemMockingTestCase): initer.read_cfg() initer.initialize() initer.fetch() - _iid = initer.instancify() + initer.instancify() initer.update() initer.cloudify().run('consume_data', initer.consume_data, @@ -221,7 +221,7 @@ run: initer.read_cfg() initer.initialize() initer.fetch() - _iid = initer.instancify() + initer.instancify() initer.update() initer.cloudify().run('consume_data', initer.consume_data, @@ -256,7 +256,7 @@ vendor_data: initer.read_cfg() initer.initialize() initer.fetch() - _iid = initer.instancify() + initer.instancify() initer.update() initer.cloudify().run('consume_data', initer.consume_data, @@ -264,7 +264,6 @@ vendor_data: freq=PER_INSTANCE) mods = stages.Modules(initer) (_which_ran, _failures) = mods.run_section('cloud_init_modules') - _cfg = mods.cfg vendor_script = initer.paths.get_ipath_cur('vendor_scripts') vendor_script_fns = "%s%s/part-001" % (new_root, vendor_script) self.assertTrue(os.path.exists(vendor_script_fns)) diff --git a/tests/unittests/test_datasource/test_nocloud.py b/tests/unittests/test_datasource/test_nocloud.py index 8bcc026c..e9235951 100644 --- a/tests/unittests/test_datasource/test_nocloud.py +++ b/tests/unittests/test_datasource/test_nocloud.py @@ -57,7 +57,6 @@ class TestNoCloudDataSource(MockerTestCase): pass def my_find_devs_with(*args, **kwargs): - _f = (args, kwargs) raise PsuedoException self.apply_patches([(util, 'find_devs_with', my_find_devs_with)]) diff --git a/tests/unittests/test_runs/test_merge_run.py b/tests/unittests/test_runs/test_merge_run.py index 32b41925..977adb34 100644 --- a/tests/unittests/test_runs/test_merge_run.py +++ b/tests/unittests/test_runs/test_merge_run.py @@ -33,7 +33,7 @@ class TestMergeRun(helpers.FilesystemMockingTestCase): initer.initialize() initer.fetch() initer.datasource.userdata_raw = ud - _iid = initer.instancify() + initer.instancify() initer.update() initer.cloudify().run('consume_data', initer.consume_data, |