Only pep8 violations fix
fix pep8 violations fix tox configurtion for pep8 fix pretty print for actions that return a response body Change-Id: I39a529bda8780649a5159761af7103eee8520412
This commit is contained in:
parent
88c74ba804
commit
844492a8eb
@ -209,6 +209,7 @@ COMMANDS = {'auth': common.Auth,
|
||||
'version': VersionCommands,
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
# Parse arguments
|
||||
load_file = True
|
||||
|
@ -274,7 +274,6 @@ class ReddwarfHTTPClient(httplib2.Http):
|
||||
self.service_url = service_url
|
||||
|
||||
|
||||
|
||||
class Dbaas(object):
|
||||
"""
|
||||
Top-level object to access the Rackspace Database as a Service API.
|
||||
|
@ -111,7 +111,6 @@ class CliOptions(object):
|
||||
print("ERROR: Token file found at %s was corrupt." % cls.APITOKEN)
|
||||
return cls.default()
|
||||
|
||||
|
||||
@classmethod
|
||||
def save_from_instance_fields(cls, instance):
|
||||
apitoken = cls.default()
|
||||
@ -121,7 +120,6 @@ class CliOptions(object):
|
||||
with open(cls.APITOKEN, 'wb') as token:
|
||||
pickle.dump(apitoken, token, protocol=2)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create_optparser(cls, load_file):
|
||||
oparser = optparse.OptionParser(
|
||||
@ -131,6 +129,7 @@ class CliOptions(object):
|
||||
file = cls.load_from_file()
|
||||
else:
|
||||
file = cls.default()
|
||||
|
||||
def add_option(*args, **kwargs):
|
||||
if len(args) == 1:
|
||||
name = args[0]
|
||||
@ -165,7 +164,6 @@ class CliOptions(object):
|
||||
add_option("token", help="Token from a prior login.")
|
||||
add_option("xml", action="store_true", help="Changes format to XML.")
|
||||
|
||||
|
||||
oparser.add_option("--secure", action="store_false", dest="insecure",
|
||||
help="Run in insecure mode for https endpoints.")
|
||||
oparser.add_option("--json", action="store_false", dest="xml",
|
||||
@ -256,6 +254,7 @@ class CommandsBase(object):
|
||||
if self.verbose:
|
||||
self._safe_exec(func, *args, **kwargs)
|
||||
return # Skip this, since the verbose stuff will show up anyway.
|
||||
|
||||
def wrapped_func():
|
||||
result = func(*args, **kwargs)
|
||||
if result:
|
||||
|
@ -35,8 +35,8 @@ class DiagnosticsInterrogator(base.ManagerWithFind):
|
||||
"""
|
||||
Get the diagnostics of the guest on the instance.
|
||||
"""
|
||||
return self._get("/mgmt/instances/%s/diagnostics" % base.getid(instance),
|
||||
"diagnostics")
|
||||
return self._get("/mgmt/instances/%s/diagnostics" %
|
||||
base.getid(instance), "diagnostics")
|
||||
|
||||
|
||||
class HwInfo(base.Resource):
|
||||
|
@ -12,6 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
class UnsupportedVersion(Exception):
|
||||
"""Indicates that the user is trying to use an unsupported
|
||||
version of the API"""
|
||||
@ -55,6 +56,7 @@ class ResponseFormatError(Exception):
|
||||
"""Could not parse the response format."""
|
||||
pass
|
||||
|
||||
|
||||
class AmbiguousEndpoints(Exception):
|
||||
"""Found more than one matching endpoint in Service Catalog."""
|
||||
def __init__(self, endpoints=None):
|
||||
|
@ -158,6 +158,7 @@ class Instances(base.ManagerWithFind):
|
||||
|
||||
Instances.resize_flavor = Instances.resize_instance
|
||||
|
||||
|
||||
class InstanceStatus(object):
|
||||
|
||||
ACTIVE = "ACTIVE"
|
||||
|
@ -24,6 +24,7 @@ LISTIFY = {
|
||||
|
||||
REQUEST_AS_LIST = set(['databases', 'users'])
|
||||
|
||||
|
||||
def element_ancestors_match_list(element, list):
|
||||
"""
|
||||
For element root at <foo><blah><root></blah></foo> matches against
|
||||
@ -55,6 +56,7 @@ def element_to_json(name, element):
|
||||
else:
|
||||
return element_to_dict(element)
|
||||
|
||||
|
||||
def root_element_to_json(name, element):
|
||||
"""Returns a tuple of the root JSON value, plus the links if found."""
|
||||
if name == "rootEnabled": # Why oh why were we inconsistent here? :'(
|
||||
|
3
tox.ini
3
tox.ini
@ -11,3 +11,6 @@ deps =
|
||||
commands =
|
||||
sphinx-build -b doctest {toxinidir}/docs/source {envtmpdir}/html
|
||||
sphinx-build -b html {toxinidir}/docs/source {envtmpdir}/html
|
||||
|
||||
[testenv:pep8]
|
||||
commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc reddwarfclient setup.py
|
Loading…
x
Reference in New Issue
Block a user