Skip to content
Snippets Groups Projects
Commit 94cdfa4a authored by Iustin Pop's avatar Iustin Pop
Browse files

Simplify handling of boolean args in rapi


This patch replaces hardcoded boolean-type args with
bool(_checkIntVariable). There should be no other cases of this left, I
think.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 97c61d46
No related branches found
No related tags found
No related merge requests found
......@@ -441,8 +441,7 @@ class R_2_instances_name_reboot(baserlib.R_Generic):
instance_name = self.items[0]
reboot_type = self.queryargs.get('type',
[constants.INSTANCE_REBOOT_HARD])[0]
ignore_secondaries = bool(self.queryargs.get('ignore_secondaries',
[False])[0])
ignore_secondaries = bool(self._checkIntVariable('ignore_secondaries'))
op = opcodes.OpRebootInstance(instance_name=instance_name,
reboot_type=reboot_type,
ignore_secondaries=ignore_secondaries)
......@@ -467,7 +466,7 @@ class R_2_instances_name_startup(baserlib.R_Generic):
"""
instance_name = self.items[0]
force_startup = bool(self.queryargs.get('force', [False])[0])
force_startup = bool(self._checkIntVariable('force'))
op = opcodes.OpStartupInstance(instance_name=instance_name,
force=force_startup)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment