Commit 2f79bd34 authored by Iustin Pop's avatar Iustin Pop

Fix some pylint-detected issues on the scripts

Some names were wrong, and similar stuff detected by pylint.
gnt-debug.GenericOpCode is still broken.

Reviewed-by: imsnah
parent 3a24c527
......@@ -19,11 +19,14 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
from optparse import make_option
from ganeti.cli import *
from ganeti import cmdlib
from ganeti import opcodes
from ganeti import constants
......
......@@ -19,6 +19,10 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
from optparse import make_option
import os.path
......@@ -30,7 +34,6 @@ from ganeti import errors
from ganeti import utils
from ganeti import bootstrap
from ganeti import ssh
from ganeti import ssconf
def InitCluster(opts, args):
......
......@@ -19,14 +19,15 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
import os
import itertools
import simplejson
import time
from optparse import make_option
from cStringIO import StringIO
from ganeti.cli import *
from ganeti import opcodes
......
......@@ -19,6 +19,10 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
import os
import itertools
......@@ -353,9 +357,9 @@ def BatchCreate(opts, args):
def _PopulateWithDefaults(spec):
"""Returns a new hash combined with default values."""
dict = _DEFAULT_SPECS.copy()
dict.update(spec)
return dict
mydict = _DEFAULT_SPECS.copy()
mydict.update(spec)
return mydict
def _Validate(spec):
"""Validate the instance specs."""
......@@ -456,9 +460,9 @@ def ReinstallInstance(opts, args):
ToStdout("User aborted reinstall, exiting")
return 1
os = selected
os_name = selected
else:
os = opts.os
os_name = opts.os
if not opts.force:
usertext = ("This will reinstall the instance %s and remove"
......@@ -467,7 +471,7 @@ def ReinstallInstance(opts, args):
return 1
op = opcodes.OpReinstallInstance(instance_name=instance_name,
os_type=os)
os_type=os_name)
SubmitOrSend(op, opts)
return 0
......@@ -726,7 +730,7 @@ def ConnectToInstanceConsole(opts, args):
os.execvp(cmd[0], cmd)
finally:
ToStderr("Can't run console command %s with arguments:\n'%s'",
cmd, " ".join(argv))
cmd[0], " ".join(cmd))
os._exit(1)
......
......@@ -19,17 +19,14 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
import os
import itertools
import time
from optparse import make_option
from cStringIO import StringIO
from ganeti.cli import *
from ganeti import opcodes
from ganeti import constants
from ganeti import utils
from ganeti import errors
......@@ -184,7 +181,7 @@ def ShowJobs(opts, args):
if status in _USER_JOB_STATUS:
status = _USER_JOB_STATUS[status]
else:
raise errors.ProgrammerError("Unknown job status code '%s'" % val)
raise errors.ProgrammerError("Unknown job status code '%s'" % status)
format(1, "Status: %s" % status)
......
......@@ -19,6 +19,10 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
from optparse import make_option
......
......@@ -19,14 +19,16 @@
# 02110-1301, USA.
# pylint: disable-msg=W0401,W0614
# W0401: Wildcard import ganeti.cli
# W0614: Unused import %s from wildcard import (since we need cli)
import sys
from optparse import make_option
from ganeti.cli import *
from ganeti import opcodes
from ganeti import objects
from ganeti import utils
from ganeti import errors
from ganeti import constants
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment