Fixed various flake8 errors
This commit is contained in:
@@ -23,8 +23,8 @@ from oslo.config import cfg
|
|||||||
|
|
||||||
from cloudbaseinit.metadata.services import base
|
from cloudbaseinit.metadata.services import base
|
||||||
from cloudbaseinit.metadata.services import baseopenstackservice
|
from cloudbaseinit.metadata.services import baseopenstackservice
|
||||||
from cloudbaseinit.openstack.common import log as logging
|
|
||||||
from cloudbaseinit.metadata.services.osconfigdrive import factory
|
from cloudbaseinit.metadata.services.osconfigdrive import factory
|
||||||
|
from cloudbaseinit.openstack.common import log as logging
|
||||||
|
|
||||||
opts = [
|
opts = [
|
||||||
cfg.BoolOpt('config_drive_raw_hhd', default=True,
|
cfg.BoolOpt('config_drive_raw_hhd', default=True,
|
||||||
|
@@ -46,14 +46,14 @@ msvcrt = ctypes.cdll.msvcrt
|
|||||||
|
|
||||||
class Win32_PROFILEINFO(ctypes.Structure):
|
class Win32_PROFILEINFO(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('dwSize', wintypes.DWORD),
|
('dwSize', wintypes.DWORD),
|
||||||
('dwFlags', wintypes.DWORD),
|
('dwFlags', wintypes.DWORD),
|
||||||
('lpUserName', wintypes.LPWSTR),
|
('lpUserName', wintypes.LPWSTR),
|
||||||
('lpProfilePath', wintypes.LPWSTR),
|
('lpProfilePath', wintypes.LPWSTR),
|
||||||
('lpDefaultPath', wintypes.LPWSTR),
|
('lpDefaultPath', wintypes.LPWSTR),
|
||||||
('lpServerName', wintypes.LPWSTR),
|
('lpServerName', wintypes.LPWSTR),
|
||||||
('lpPolicyPath', wintypes.LPWSTR),
|
('lpPolicyPath', wintypes.LPWSTR),
|
||||||
('hprofile', wintypes.HANDLE)
|
('hprofile', wintypes.HANDLE)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -21,8 +21,8 @@ import io
|
|||||||
from cloudbaseinit.metadata.services import base as metadata_services_base
|
from cloudbaseinit.metadata.services import base as metadata_services_base
|
||||||
from cloudbaseinit.openstack.common import log as logging
|
from cloudbaseinit.openstack.common import log as logging
|
||||||
from cloudbaseinit.plugins import base
|
from cloudbaseinit.plugins import base
|
||||||
from cloudbaseinit.plugins.windows import userdatautils
|
|
||||||
from cloudbaseinit.plugins.windows.userdataplugins import factory
|
from cloudbaseinit.plugins.windows.userdataplugins import factory
|
||||||
|
from cloudbaseinit.plugins.windows import userdatautils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import tempfile
|
|
||||||
import os
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
from cloudbaseinit.openstack.common import log as logging
|
from cloudbaseinit.openstack.common import log as logging
|
||||||
from cloudbaseinit.plugins.windows import fileexecutils
|
from cloudbaseinit.plugins.windows import fileexecutils
|
||||||
|
@@ -331,7 +331,7 @@ class CryptoAPICertManagerTests(unittest.TestCase):
|
|||||||
mock_byref(), None, None),
|
mock_byref(), None, None),
|
||||||
mock.call('fake cert', len('fake cert'),
|
mock.call('fake cert', len('fake cert'),
|
||||||
self.x509.cryptoapi.CRYPT_STRING_BASE64,
|
self.x509.cryptoapi.CRYPT_STRING_BASE64,
|
||||||
mock_cast(), mock_byref(), None, None)]
|
mock_cast(), mock_byref(), None, None)]
|
||||||
expected2 = [mock.call(mock_POINTER()(),
|
expected2 = [mock.call(mock_POINTER()(),
|
||||||
self.x509.cryptoapi.CERT_NAME_UPN_TYPE,
|
self.x509.cryptoapi.CERT_NAME_UPN_TYPE,
|
||||||
0, None, None, 0),
|
0, None, None, 0),
|
||||||
|
@@ -32,59 +32,59 @@ class CryptoAPIException(Exception):
|
|||||||
|
|
||||||
class SYSTEMTIME(ctypes.Structure):
|
class SYSTEMTIME(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('wYear', wintypes.WORD),
|
('wYear', wintypes.WORD),
|
||||||
('wMonth', wintypes.WORD),
|
('wMonth', wintypes.WORD),
|
||||||
('wDayOfWeek', wintypes.WORD),
|
('wDayOfWeek', wintypes.WORD),
|
||||||
('wDay', wintypes.WORD),
|
('wDay', wintypes.WORD),
|
||||||
('wHour', wintypes.WORD),
|
('wHour', wintypes.WORD),
|
||||||
('wMinute', wintypes.WORD),
|
('wMinute', wintypes.WORD),
|
||||||
('wSecond', wintypes.WORD),
|
('wSecond', wintypes.WORD),
|
||||||
('wMilliseconds', wintypes.WORD),
|
('wMilliseconds', wintypes.WORD),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CERT_CONTEXT(ctypes.Structure):
|
class CERT_CONTEXT(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('dwCertEncodingType', wintypes.DWORD),
|
('dwCertEncodingType', wintypes.DWORD),
|
||||||
('pbCertEncoded', ctypes.POINTER(wintypes.BYTE)),
|
('pbCertEncoded', ctypes.POINTER(wintypes.BYTE)),
|
||||||
('cbCertEncoded', wintypes.DWORD),
|
('cbCertEncoded', wintypes.DWORD),
|
||||||
('pCertInfo', ctypes.c_void_p),
|
('pCertInfo', ctypes.c_void_p),
|
||||||
('hCertStore', wintypes.HANDLE),
|
('hCertStore', wintypes.HANDLE),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CRYPTOAPI_BLOB(ctypes.Structure):
|
class CRYPTOAPI_BLOB(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('cbData', wintypes.DWORD),
|
('cbData', wintypes.DWORD),
|
||||||
('pbData', ctypes.POINTER(wintypes.BYTE)),
|
('pbData', ctypes.POINTER(wintypes.BYTE)),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CRYPT_ALGORITHM_IDENTIFIER(ctypes.Structure):
|
class CRYPT_ALGORITHM_IDENTIFIER(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('pszObjId', wintypes.LPSTR),
|
('pszObjId', wintypes.LPSTR),
|
||||||
('Parameters', CRYPTOAPI_BLOB),
|
('Parameters', CRYPTOAPI_BLOB),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CRYPT_KEY_PROV_PARAM(ctypes.Structure):
|
class CRYPT_KEY_PROV_PARAM(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('dwParam', wintypes.DWORD),
|
('dwParam', wintypes.DWORD),
|
||||||
('pbData', ctypes.POINTER(wintypes.BYTE)),
|
('pbData', ctypes.POINTER(wintypes.BYTE)),
|
||||||
('cbData', wintypes.DWORD),
|
('cbData', wintypes.DWORD),
|
||||||
('dwFlags', wintypes.DWORD),
|
('dwFlags', wintypes.DWORD),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CRYPT_KEY_PROV_INFO(ctypes.Structure):
|
class CRYPT_KEY_PROV_INFO(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('pwszContainerName', wintypes.LPWSTR),
|
('pwszContainerName', wintypes.LPWSTR),
|
||||||
('pwszProvName', wintypes.LPWSTR),
|
('pwszProvName', wintypes.LPWSTR),
|
||||||
('dwProvType', wintypes.DWORD),
|
('dwProvType', wintypes.DWORD),
|
||||||
('dwFlags', wintypes.DWORD),
|
('dwFlags', wintypes.DWORD),
|
||||||
('cProvParam', wintypes.DWORD),
|
('cProvParam', wintypes.DWORD),
|
||||||
('cProvParam', ctypes.POINTER(CRYPT_KEY_PROV_PARAM)),
|
('cProvParam', ctypes.POINTER(CRYPT_KEY_PROV_PARAM)),
|
||||||
('dwKeySpec', wintypes.DWORD),
|
('dwKeySpec', wintypes.DWORD),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -144,14 +144,14 @@ class IP_ADAPTER_ADDRESSES(ctypes.Structure):
|
|||||||
('DnsSuffix', wintypes.LPWSTR),
|
('DnsSuffix', wintypes.LPWSTR),
|
||||||
('Description', wintypes.LPWSTR),
|
('Description', wintypes.LPWSTR),
|
||||||
('FriendlyName', wintypes.LPWSTR),
|
('FriendlyName', wintypes.LPWSTR),
|
||||||
('PhysicalAddress', ctypes.c_ubyte*MAX_ADAPTER_ADDRESS_LENGTH),
|
('PhysicalAddress', ctypes.c_ubyte * MAX_ADAPTER_ADDRESS_LENGTH),
|
||||||
('PhysicalAddressLength', wintypes.DWORD),
|
('PhysicalAddressLength', wintypes.DWORD),
|
||||||
('Flags', wintypes.DWORD),
|
('Flags', wintypes.DWORD),
|
||||||
('Mtu', wintypes.DWORD),
|
('Mtu', wintypes.DWORD),
|
||||||
('IfType', wintypes.DWORD),
|
('IfType', wintypes.DWORD),
|
||||||
('OperStatus', wintypes.DWORD),
|
('OperStatus', wintypes.DWORD),
|
||||||
('Ipv6IfIndex', wintypes.DWORD),
|
('Ipv6IfIndex', wintypes.DWORD),
|
||||||
('ZoneIndices', wintypes.DWORD*16),
|
('ZoneIndices', wintypes.DWORD * 16),
|
||||||
('FirstPrefix', ctypes.POINTER(IP_ADAPTER_PREFIX)),
|
('FirstPrefix', ctypes.POINTER(IP_ADAPTER_PREFIX)),
|
||||||
# kernel >= 6.0
|
# kernel >= 6.0
|
||||||
('TransmitLinkSpeed', wintypes.ULARGE_INTEGER),
|
('TransmitLinkSpeed', wintypes.ULARGE_INTEGER),
|
||||||
@@ -169,7 +169,7 @@ class IP_ADAPTER_ADDRESSES(ctypes.Structure):
|
|||||||
('ConnectionType', wintypes.DWORD),
|
('ConnectionType', wintypes.DWORD),
|
||||||
('TunnelType', wintypes.DWORD),
|
('TunnelType', wintypes.DWORD),
|
||||||
('Dhcpv6Server', SOCKET_ADDRESS),
|
('Dhcpv6Server', SOCKET_ADDRESS),
|
||||||
('Dhcpv6ClientDuid', ctypes.c_ubyte*MAX_DHCPV6_DUID_LENGTH),
|
('Dhcpv6ClientDuid', ctypes.c_ubyte * MAX_DHCPV6_DUID_LENGTH),
|
||||||
('Dhcpv6ClientDuidLength', wintypes.ULONG),
|
('Dhcpv6ClientDuidLength', wintypes.ULONG),
|
||||||
('Dhcpv6Iaid', wintypes.ULONG),
|
('Dhcpv6Iaid', wintypes.ULONG),
|
||||||
]
|
]
|
||||||
|
@@ -26,11 +26,11 @@ class Win32_DiskGeometry(ctypes.Structure):
|
|||||||
FixedMedia = 12
|
FixedMedia = 12
|
||||||
|
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('Cylinders', wintypes.LARGE_INTEGER),
|
('Cylinders', wintypes.LARGE_INTEGER),
|
||||||
('MediaType', wintypes.DWORD),
|
('MediaType', wintypes.DWORD),
|
||||||
('TracksPerCylinder', wintypes.DWORD),
|
('TracksPerCylinder', wintypes.DWORD),
|
||||||
('SectorsPerTrack', wintypes.DWORD),
|
('SectorsPerTrack', wintypes.DWORD),
|
||||||
('BytesPerSector', wintypes.DWORD),
|
('BytesPerSector', wintypes.DWORD),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -27,13 +27,13 @@ VERSION_2_2 = (2 << 8) + 2
|
|||||||
class SOCKADDR(ctypes.Structure):
|
class SOCKADDR(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('sa_family', wintypes.USHORT),
|
('sa_family', wintypes.USHORT),
|
||||||
('sa_data', ctypes.c_char*14),
|
('sa_data', ctypes.c_char * 14),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class WSADATA(ctypes.Structure):
|
class WSADATA(ctypes.Structure):
|
||||||
_fields_ = [
|
_fields_ = [
|
||||||
('opaque_data', wintypes.BYTE*400),
|
('opaque_data', wintypes.BYTE * 400),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user