Sandro Bonazzola has uploaded a new change for review. Change subject: packaging: setup: reduce use of lists ......................................................................
packaging: setup: reduce use of lists Aligned with ovirt-engine-setup coding. Change-Id: I047600afaf59ce035c891188a32b3110d794a54a Signed-off-by: Sandro Bonazzola <[email protected]> --- M src/plugins/ovirt-hosted-engine-setup/core/conf.py M src/plugins/ovirt-hosted-engine-setup/core/misc.py M src/plugins/ovirt-hosted-engine-setup/engine/add_host.py M src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py M src/plugins/ovirt-hosted-engine-setup/engine/health.py M src/plugins/ovirt-hosted-engine-setup/engine/os_install.py M src/plugins/ovirt-hosted-engine-setup/ha/ha_services.py M src/plugins/ovirt-hosted-engine-setup/network/firewall.py M src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py M src/plugins/ovirt-hosted-engine-setup/pki/vdsmpki.py M src/plugins/ovirt-hosted-engine-setup/storage/storage.py M src/plugins/ovirt-hosted-engine-setup/system/vdsmenv.py M src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py M src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py M src/plugins/ovirt-hosted-engine-setup/vm/cpu.py M src/plugins/ovirt-hosted-engine-setup/vm/image.py M src/plugins/ovirt-hosted-engine-setup/vm/memory.py M src/plugins/ovirt-hosted-engine-setup/vm/runvm.py 18 files changed, 56 insertions(+), 53 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup refs/changes/01/17601/1 diff --git a/src/plugins/ovirt-hosted-engine-setup/core/conf.py b/src/plugins/ovirt-hosted-engine-setup/core/conf.py index bfdefb7..e40c502 100644 --- a/src/plugins/ovirt-hosted-engine-setup/core/conf.py +++ b/src/plugins/ovirt-hosted-engine-setup/core/conf.py @@ -47,10 +47,10 @@ @plugin.event( stage=plugin.Stages.STAGE_MISC, - after=[ + after=( ohostedcons.Stages.VM_IMAGE_AVAILABLE, ohostedcons.Stages.BRIDGE_AVAILABLE, - ], + ), name=ohostedcons.Stages.SAVE_CONFIG, ) def _misc(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/core/misc.py b/src/plugins/ovirt-hosted-engine-setup/core/misc.py index 4bbad81..707229c 100644 --- a/src/plugins/ovirt-hosted-engine-setup/core/misc.py +++ b/src/plugins/ovirt-hosted-engine-setup/core/misc.py @@ -45,10 +45,10 @@ @plugin.event( stage=plugin.Stages.STAGE_BOOT, - before=[ + before=( otopicons.Stages.CORE_LOG_INIT, otopicons.Stages.CORE_CONFIG_INIT, - ], + ), ) def _preinit(self): self.environment.setdefault( diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py b/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py index 5becf66..ff7a57a 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py @@ -258,9 +258,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, - after=[ + after=( ohostedcons.Stages.ENGINE_ALIVE, - ], + ), name=ohostedcons.Stages.HOST_ADDED, ) def _closeup(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py b/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py index c1fa394..1ce7a69 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/fqdn.py @@ -180,10 +180,10 @@ ) def _resolvedByDNS(self, fqdn): - args = [ + args = ( self.command.get('dig'), - fqdn - ] + fqdn, + ) rc, stdout, stderr = self.execute( args=args, raiseOnError=False @@ -197,11 +197,11 @@ def _dig_reverse_lookup(self, addr): names = set() - args = [ + args = ( self.command.get('dig'), '-x', addr, - ] + ) rc, stdout, stderr = self.execute( args=args, raiseOnError=False diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/health.py b/src/plugins/ovirt-hosted-engine-setup/engine/health.py index 755833d..7d0ba88 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/health.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/health.py @@ -48,9 +48,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, - after=[ + after=( ohostedcons.Stages.INSTALLED_VM_RUNNING, - ], + ), name=ohostedcons.Stages.ENGINE_ALIVE, ) def _closeup(self): @@ -81,7 +81,10 @@ '(@VALUES@)[@DEFAULT@]: ' ), prompt=True, - validValues=[_('Check'), _('Abort')], + validValues=( + _('Check'), + _('Abort'), + ), caseSensitive=False, default=_('Check') ) != _('Check').lower(): diff --git a/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py b/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py index b7382b8..9a5388d 100644 --- a/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py +++ b/src/plugins/ovirt-hosted-engine-setup/engine/os_install.py @@ -50,9 +50,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, - after=[ + after=( ohostedcons.Stages.VM_RUNNING, - ], + ), name=ohostedcons.Stages.OS_INSTALLED, condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST diff --git a/src/plugins/ovirt-hosted-engine-setup/ha/ha_services.py b/src/plugins/ovirt-hosted-engine-setup/ha/ha_services.py index a243c41..fef4f2f 100644 --- a/src/plugins/ovirt-hosted-engine-setup/ha/ha_services.py +++ b/src/plugins/ovirt-hosted-engine-setup/ha/ha_services.py @@ -50,9 +50,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, - after=[ + after=( ohostedcons.Stages.HOST_ADDED, - ], + ), name=ohostedcons.Stages.HA_START, ) def _closeup(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/network/firewall.py b/src/plugins/ovirt-hosted-engine-setup/network/firewall.py index 42c86d0..94ca992 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/firewall.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/firewall.py @@ -46,12 +46,12 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, - before=[ + before=( ohostedcons.Stages.NET_FIREWALL_MANAGER_PROCESS_TEMPLATES, - ], - after=[ + ), + after=( ohostedcons.Stages.NET_FIREWALL_MANAGER_AVAILABLE, - ], + ), condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], diff --git a/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py b/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py index d3c204a..a6d0f3d 100644 --- a/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py +++ b/src/plugins/ovirt-hosted-engine-setup/network/firewall_manager.py @@ -172,9 +172,9 @@ stage=plugin.Stages.STAGE_CUSTOMIZATION, name=ohostedcons.Stages.NET_FIREWALL_MANAGER_PROCESS_TEMPLATES, priority=plugin.Stages.PRIORITY_LOW, - after=[ + after=( ohostedcons.Stages.NET_FIREWALL_MANAGER_AVAILABLE, - ], + ), condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], diff --git a/src/plugins/ovirt-hosted-engine-setup/pki/vdsmpki.py b/src/plugins/ovirt-hosted-engine-setup/pki/vdsmpki.py index c9e6d44..65f4d25 100644 --- a/src/plugins/ovirt-hosted-engine-setup/pki/vdsmpki.py +++ b/src/plugins/ovirt-hosted-engine-setup/pki/vdsmpki.py @@ -61,9 +61,9 @@ def _generateVDSMcerts(self): self.logger.info(_('Generating VDSM certificates')) rc, stdout, stderr = self.execute( - [ - ohostedcons.FileLocations.VDSM_GEN_CERTS - ], + ( + ohostedcons.FileLocations.VDSM_GEN_CERTS, + ), raiseOnError=True ) diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py index 6136a97..d778d88 100644 --- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py +++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py @@ -104,7 +104,7 @@ '(@VALUES@)[@DEFAULT@]? ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('Yes') ) == _('Yes').lower() @@ -557,9 +557,9 @@ @plugin.event( stage=plugin.Stages.STAGE_MISC, - after=[ + after=( ohostedcons.Stages.VDSMD_START, - ], + ), name=ohostedcons.Stages.STORAGE_AVAILABLE, ) def _misc(self): diff --git a/src/plugins/ovirt-hosted-engine-setup/system/vdsmenv.py b/src/plugins/ovirt-hosted-engine-setup/system/vdsmenv.py index d8c9ed9..e18af50 100644 --- a/src/plugins/ovirt-hosted-engine-setup/system/vdsmenv.py +++ b/src/plugins/ovirt-hosted-engine-setup/system/vdsmenv.py @@ -104,9 +104,9 @@ @plugin.event( stage=plugin.Stages.STAGE_LATE_SETUP, - after=[ + after=( ohostedcons.Stages.VDSMD_CONF_LOADED, - ], + ), ) def _late_setup(self): #We need vdsmd up for customization checks @@ -121,11 +121,11 @@ @plugin.event( stage=plugin.Stages.STAGE_MISC, name=ohostedcons.Stages.VDSMD_START, - after=[ + after=( ohostedcons.Stages.LIBVIRT_CONFIGURED, ohostedcons.Stages.VDSMD_PKI, ohostedcons.Stages.VDSMD_CONFIGURED, - ], + ), ) def _misc(self): self.logger.info( diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py b/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py index 4644dae..fefd792 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/boot_cdrom.py @@ -82,9 +82,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, - after=[ + after=( ohostedcons.Stages.CONFIG_BOOT_DEVICE, - ], + ), condition=lambda self: ( self.environment[ohostedcons.VMEnv.BOOT] == 'cdrom' and not self.environment[ohostedcons.CoreEnv.IS_ADDITIONAL_HOST] diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py index 5d543cf..4a34652 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/configurevm.py @@ -127,10 +127,10 @@ @plugin.event( stage=plugin.Stages.STAGE_MISC, - after=[ + after=( ohostedcons.Stages.VM_IMAGE_AVAILABLE, ohostedcons.Stages.BRIDGE_AVAILABLE, - ], + ), name=ohostedcons.Stages.VM_CONFIGURED, condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py index 8e86a32..9ccddae 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py @@ -56,9 +56,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, - after=[ + after=( ohostedcons.Stages.CONFIG_OVF_IMPORT, - ], + ), condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], @@ -101,7 +101,7 @@ '(@VALUES@)[@DEFAULT]: ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('No') ) == _('Yes').lower() diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/image.py b/src/plugins/ovirt-hosted-engine-setup/vm/image.py index f18a8ed..e03011b 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/image.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/image.py @@ -72,9 +72,9 @@ condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], - after=[ + after=( ohostedcons.Stages.CONFIG_OVF_IMPORT, - ], + ), ) def _disk_customization(self): interactive = self.environment[ @@ -114,7 +114,7 @@ '(@VALUES@)[@DEFAULT]: ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('No') ) == _('Yes').lower() @@ -141,9 +141,9 @@ @plugin.event( stage=plugin.Stages.STAGE_MISC, - after=[ + after=( ohostedcons.Stages.STORAGE_AVAILABLE, - ], + ), name=ohostedcons.Stages.VM_IMAGE_AVAILABLE, condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py index c3362b4..a65e3e2 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py @@ -59,9 +59,9 @@ condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST ], - after=[ + after=( ohostedcons.Stages.CONFIG_OVF_IMPORT, - ], + ), ) def _customization(self): interactive = self.environment[ @@ -101,7 +101,7 @@ '(@VALUES@)[@DEFAULT]: ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('No') ) == _('Yes').lower() diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py b/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py index d07f527..8c41a27 100644 --- a/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py +++ b/src/plugins/ovirt-hosted-engine-setup/vm/runvm.py @@ -277,7 +277,7 @@ '(@VALUES@)[@DEFAULT@]: ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('Yes') ) == _('Yes').lower() @@ -290,7 +290,7 @@ 'installation? (@VALUES@)[@DEFAULT@]: ' ), prompt=True, - validValues=[_('Yes'), _('No')], + validValues=(_('Yes'), _('No')), caseSensitive=False, default=_('Yes') ) == _('No').lower() @@ -302,9 +302,9 @@ @plugin.event( stage=plugin.Stages.STAGE_CLOSEUP, - after=[ + after=( ohostedcons.Stages.OS_INSTALLED, - ], + ), name=ohostedcons.Stages.INSTALLED_VM_RUNNING, condition=lambda self: not self.environment[ ohostedcons.CoreEnv.IS_ADDITIONAL_HOST -- To view, visit http://gerrit.ovirt.org/17601 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I047600afaf59ce035c891188a32b3110d794a54a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-setup Gerrit-Branch: master Gerrit-Owner: Sandro Bonazzola <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
