From 184f183311c0bb36e32397c172594d3a47007119 Mon Sep 17 00:00:00 2001 From: Robert Tingirica Date: Wed, 11 Jun 2014 16:45:22 +0300 Subject: [PATCH] Fixed a few pep8 nits --- cloudbaseinit/osutils/windows.py | 4 ++-- cloudbaseinit/plugins/windows/extendvolumes.py | 2 +- cloudbaseinit/utils/crypt.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudbaseinit/osutils/windows.py b/cloudbaseinit/osutils/windows.py index 060d0b2e..8782a109 100644 --- a/cloudbaseinit/osutils/windows.py +++ b/cloudbaseinit/osutils/windows.py @@ -589,7 +589,7 @@ class WindowsUtils(base.BaseOSUtils): return service.StartMode def set_service_start_mode(self, service_name, start_mode): - #TODO(alexpilotti): Handle the "Delayed Start" case + # TODO(alexpilotti): Handle the "Delayed Start" case service = self._get_service(service_name) (ret_val,) = service.ChangeStartMode(start_mode) if ret_val != 0: @@ -806,7 +806,7 @@ class WindowsUtils(base.BaseOSUtils): try: # NOTE(alexpilotti): the size provided by ctypes.sizeof # is not the expected one - #pdidd.contents.cbSize = ctypes.sizeof( + # pdidd.contents.cbSize = ctypes.sizeof( # Win32_SP_DEVICE_INTERFACE_DETAIL_DATA_W) pdidd.contents.cbSize = 6 diff --git a/cloudbaseinit/plugins/windows/extendvolumes.py b/cloudbaseinit/plugins/windows/extendvolumes.py index c48bf8f4..1dfb5370 100644 --- a/cloudbaseinit/plugins/windows/extendvolumes.py +++ b/cloudbaseinit/plugins/windows/extendvolumes.py @@ -57,7 +57,7 @@ class ExtendVolumesPlugin(base.BasePlugin): if volume_idxs is not None: volume_name = ctypes.wstring_at(volume_prop.pwszName) volume_idx = self._get_volume_index(volume_name) - if not volume_idx in volume_idxs: + if volume_idx not in volume_idxs: extend_volume = False if extend_volume: diff --git a/cloudbaseinit/utils/crypt.py b/cloudbaseinit/utils/crypt.py index 1eee7c14..c125e66b 100644 --- a/cloudbaseinit/utils/crypt.py +++ b/cloudbaseinit/utils/crypt.py @@ -161,7 +161,7 @@ class CryptManager(object): key_type = pub_key[offset:offset + key_type_len] offset += key_type_len - if not key_type in ['ssh-rsa', 'rsa', 'rsa1']: + if key_type not in ['ssh-rsa', 'rsa', 'rsa1']: raise CryptException('Unsupported SSH key type "%s". ' 'Only RSA keys are currently supported' % key_type)