Hello Sandro Bonazzola,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/27149
to review the following change.
Change subject: packaging: setup: pep8 1.5.4 fixes
......................................................................
packaging: setup: pep8 1.5.4 fixes
Change-Id: I171dddd68243fa7895d25bae654e6bb723e1840e
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M packaging/pythonlib/ovirt_engine/service.py
M packaging/setup/ovirt_engine_setup/domains.py
M packaging/setup/ovirt_engine_setup/util.py
M packaging/setup/plugins/ovirt-engine-common/base/core/uninstall.py
M packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/config/ca.py
M packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/files/simple.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/cpu.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/sshd.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsm.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/iso_domain.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/sysctl.py
12 files changed, 31 insertions(+), 32 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/27149/1
diff --git a/packaging/pythonlib/ovirt_engine/service.py
b/packaging/pythonlib/ovirt_engine/service.py
index fd061a8..09ced9e 100644
--- a/packaging/pythonlib/ovirt_engine/service.py
+++ b/packaging/pythonlib/ovirt_engine/service.py
@@ -1,5 +1,5 @@
#
-# Copyright 2013 Red Hat
+# Copyright 2013-2014 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -517,7 +517,7 @@
if len(args) != 1:
parser.error(_('Action is missing'))
action = args[0]
- if not action in ('start'):
+ if action not in ('start'):
parser.error(
_("Invalid action '{action}'").format(
action=action
diff --git a/packaging/setup/ovirt_engine_setup/domains.py
b/packaging/setup/ovirt_engine_setup/domains.py
index 6a1538e..82af799 100644
--- a/packaging/setup/ovirt_engine_setup/domains.py
+++ b/packaging/setup/ovirt_engine_setup/domains.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
@util.export
class StorageDomainType(object):
- #See: org.ovirt.engine.core.common.businessentities.StorageDomainType
+ # See: org.ovirt.engine.core.common.businessentities.StorageDomainType
MASTER = 0
DATA = 1
ISO = 2
@@ -38,7 +38,7 @@
@util.export
class StorageType(object):
- #See: org.ovirt.engine.core.common.businessentities.StorageType
+ # See: org.ovirt.engine.core.common.businessentities.StorageType
UNKNOWN = 0
NFS = 1
FCP = 2
diff --git a/packaging/setup/ovirt_engine_setup/util.py
b/packaging/setup/ovirt_engine_setup/util.py
index c777133..1d6e983 100644
--- a/packaging/setup/ovirt_engine_setup/util.py
+++ b/packaging/setup/ovirt_engine_setup/util.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -163,7 +163,7 @@
# Add remaining params at the end
for param, value in params.items():
- if not param in processed:
+ if param not in processed:
newline = new_line_tpl.format(
spaces='',
param=param,
diff --git a/packaging/setup/plugins/ovirt-engine-common/base/core/uninstall.py
b/packaging/setup/plugins/ovirt-engine-common/base/core/uninstall.py
index f3830e3..8ac73a9 100644
--- a/packaging/setup/plugins/ovirt-engine-common/base/core/uninstall.py
+++ b/packaging/setup/plugins/ovirt-engine-common/base/core/uninstall.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -248,7 +248,7 @@
if not os.path.exists(os.path.dirname(output)):
os.makedirs(os.path.dirname(output))
if config.sections():
- #avoid to create empty uninstall files
+ # avoid to create empty uninstall files
with open(output, 'w') as f:
config.write(f)
diff --git
a/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/config/ca.py
b/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/config/ca.py
index 4b1a6d4..4b80f0a 100644
--- a/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/config/ca.py
+++ b/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/config/ca.py
@@ -80,7 +80,7 @@
)
os.fchmod(fd, 0o600)
with os.fdopen(fd, 'wb') as fileobj:
- #fileobj is not closed, when TarFile is closed
+ # fileobj is not closed, when TarFile is closed
# cannot use with tarfile.open() <python-2.7
tar = None
try:
diff --git
a/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/files/simple.py
b/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/files/simple.py
index e7ef095..5ff8f43 100644
--- a/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/files/simple.py
+++ b/packaging/setup/plugins/ovirt-engine-remove/ovirt-engine/files/simple.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -77,15 +77,15 @@
replace = {}
for c in changes:
- if not 'removed' in c:
+ if 'removed' not in c:
just_remove.append(c['added'])
- elif not 'added' in c:
+ elif 'added' not in c:
just_add.append(c['removed'])
else:
replace[c['added']] = c['removed']
for line in old_content:
if line not in just_remove:
- #should be updated or added
+ # should be updated or added
if line in replace:
line = replace[line]
new_content.append(line)
@@ -174,7 +174,7 @@
if (
not add_group and
interactive and
- not group in already_asked
+ group not in already_asked
):
already_asked.append(group)
add_group = dialog.queryBoolean(
@@ -212,9 +212,9 @@
def getLines(section):
associated_lines = {}
aggregated_lines = {}
- #line.{file_index:03}{line_index:03}.name
- #line.{file_index:03}{line_index:03}.content.added
- #line.{file_index:03}{line_index:03}.content.removed
+ # line.{file_index:03}{line_index:03}.name
+ # line.{file_index:03}{line_index:03}.content.added
+ # line.{file_index:03}{line_index:03}.content.removed
for name, value in config.items(section):
comps = name.split('.')
if comps[0] == 'line':
@@ -261,8 +261,8 @@
uninstall_group
)
if config.has_section(uninstall_section):
- #section could be missing in a conf file, for example if
- #PKI config was not done because already existing
+ # section could be missing in a conf file, for example if
+ # PKI config was not done because already existing
self._files.update(
getFiles(uninstall_section)
)
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/cpu.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/cpu.py
index 66daae1..f4706af 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/cpu.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/cpu.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@
state=True,
)
- #TODO: wait for libvirt to start
+ # TODO: wait for libvirt to start
ret = True
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/sshd.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/sshd.py
index 4aa5f5b..c843a70 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/sshd.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/sshd.py
@@ -164,7 +164,7 @@
with open(authorized_keys_file, 'r') as f:
content = f.read().splitlines()
- if not authorized_keys_line in content:
+ if authorized_keys_line not in content:
self.environment[
osetupcons.CoreEnv.UNINSTALL_UNREMOVABLE_FILES
].append(authorized_keys_file)
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsm.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsm.py
index 7f7dff3..275ae79 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsm.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsm.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@
try:
state = engine_api.hosts.get(host).status.state
except Exception as exc:
- #sadly all ovirtsdk errors inherit only from Exception
+ # sadly all ovirtsdk errors inherit only from Exception
self.logger.debug(
'Error fetching host state: {error}'.format(
error=str(exc),
@@ -237,7 +237,7 @@
)
self.logger.debug('Adding the local host to the local cluster')
- #At this stage sshd is already running
+ # At this stage sshd is already running
engine_api.hosts.add(
self._ovirtsdk_xml.params.Host(
name=self.environment[osetupcons.AIOEnv.LOCAL_HOST],
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/iso_domain.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/iso_domain.py
index f68fe6a..3abd4ba 100644
---
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/iso_domain.py
+++
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/config/iso_domain.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -160,7 +160,7 @@
uuid=sdUUID
)
)
- #Create images directory tree
+ # Create images directory tree
basePath = os.path.join(path, sdUUID)
self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
filetransaction.FileTransaction(
@@ -182,7 +182,7 @@
modifiedList=uninstall_files,
)
)
- #Create dom_md directory tree
+ # Create dom_md directory tree
domMdDir = os.path.join(basePath, 'dom_md')
for name in ('ids', 'inbox', 'outbox'):
filename = os.path.join(domMdDir, name)
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py
index da39971..2bd9fbb 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/nfs.py
@@ -92,7 +92,7 @@
self._enabled = not self.environment[
osetupcons.CoreEnv.DEVELOPER_MODE
]
- if not self._distribution in ('redhat', 'fedora', 'centos'):
+ if self._distribution not in ('redhat', 'fedora', 'centos'):
self.logger.warning(
_('Unsupported distribution disabling nfs export')
)
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/sysctl.py
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/sysctl.py
index 78b4858..a4c6362 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/sysctl.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/sysctl.py
@@ -1,6 +1,6 @@
#
# ovirt-engine-setup -- ovirt engine setup
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -170,7 +170,6 @@
),
)
return int(shmmax[0])
-
# vim: expandtab tabstop=4 shiftwidth=4
--
To view, visit http://gerrit.ovirt.org/27149
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I171dddd68243fa7895d25bae654e6bb723e1840e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches