Merge pull request #29 from TimSimpsonR/minor_fixes
Minor fixes and tweaks.
This commit is contained in:
@@ -198,7 +198,6 @@ class CommandsBase(object):
|
|||||||
if self.verbose:
|
if self.verbose:
|
||||||
client.log_to_streamhandler(sys.stdout)
|
client.log_to_streamhandler(sys.stdout)
|
||||||
client.RDC_PP = True
|
client.RDC_PP = True
|
||||||
|
|
||||||
return client.Dbaas(self.username, self.apikey, self.tenant_id,
|
return client.Dbaas(self.username, self.apikey, self.tenant_id,
|
||||||
auth_url=self.auth_url,
|
auth_url=self.auth_url,
|
||||||
auth_strategy=self.auth_type,
|
auth_strategy=self.auth_type,
|
||||||
@@ -256,7 +255,10 @@ class CommandsBase(object):
|
|||||||
return # Skip this, since the verbose stuff will show up anyway.
|
return # Skip this, since the verbose stuff will show up anyway.
|
||||||
def wrapped_func():
|
def wrapped_func():
|
||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
print json.dumps(result._info, sort_keys=True, indent=4)
|
if result:
|
||||||
|
print(json.dumps(result._info, sort_keys=True, indent=4))
|
||||||
|
else:
|
||||||
|
print("OK")
|
||||||
self._safe_exec(wrapped_func)
|
self._safe_exec(wrapped_func)
|
||||||
|
|
||||||
def _dumps(self, item):
|
def _dumps(self, item):
|
||||||
@@ -266,8 +268,11 @@ class CommandsBase(object):
|
|||||||
result = self._safe_exec(func, *args, **kwargs)
|
result = self._safe_exec(func, *args, **kwargs)
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
return
|
return
|
||||||
|
if result and len(result) > 0:
|
||||||
for item in result:
|
for item in result:
|
||||||
print self._dumps(item._info)
|
print(self._dumps(item._info))
|
||||||
|
else:
|
||||||
|
print("OK")
|
||||||
|
|
||||||
def _pretty_paged(self, func, *args, **kwargs):
|
def _pretty_paged(self, func, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
@@ -277,11 +282,15 @@ class CommandsBase(object):
|
|||||||
result = func(*args, limit=limit, marker=self.marker, **kwargs)
|
result = func(*args, limit=limit, marker=self.marker, **kwargs)
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
return # Verbose already shows the output, so skip this.
|
return # Verbose already shows the output, so skip this.
|
||||||
|
if result and len(result) > 0:
|
||||||
for item in result:
|
for item in result:
|
||||||
print self._dumps(item._info)
|
print self._dumps(item._info)
|
||||||
if result.links:
|
if result.links:
|
||||||
|
print("Links:")
|
||||||
for link in result.links:
|
for link in result.links:
|
||||||
print self._dumps((link))
|
print self._dumps((link))
|
||||||
|
else:
|
||||||
|
print("OK")
|
||||||
except:
|
except:
|
||||||
if self.debug:
|
if self.debug:
|
||||||
raise
|
raise
|
||||||
@@ -295,7 +304,6 @@ class Auth(CommandsBase):
|
|||||||
'auth_strategy',
|
'auth_strategy',
|
||||||
'auth_type',
|
'auth_type',
|
||||||
'auth_url',
|
'auth_url',
|
||||||
'insecure',
|
|
||||||
'options',
|
'options',
|
||||||
'region',
|
'region',
|
||||||
'service_name',
|
'service_name',
|
||||||
|
Reference in New Issue
Block a user