modjk & ssh modules: type(X) is Y ==> isinstance(X, Y)

This commit is contained in:
Chris Rebert 2014-07-25 18:53:01 -07:00
parent 263ed1ad90
commit f3830b1c44
2 changed files with 8 additions and 8 deletions

View File

@ -321,7 +321,7 @@ def bulk_stop(workers, lbn, profile='default'):
ret = {}
if type(workers) == str:
if isinstance(workers, str):
workers = workers.split(',')
for worker in workers:
@ -350,7 +350,7 @@ def bulk_activate(workers, lbn, profile='default'):
ret = {}
if type(workers) == str:
if isinstance(workers, str):
workers = workers.split(',')
for worker in workers:
@ -379,7 +379,7 @@ def bulk_disable(workers, lbn, profile='default'):
ret = {}
if type(workers) == str:
if isinstance(workers, str):
workers = workers.split(',')
for worker in workers:
@ -408,7 +408,7 @@ def bulk_recover(workers, lbn, profile='default'):
ret = {}
if type(workers) == str:
if isinstance(workers, str):
workers = workers.split(',')
for worker in workers:

View File

@ -621,7 +621,7 @@ def get_known_host(user, hostname, config=None):
'''
full = _get_known_hosts_file(config=config, user=user)
if type(full) == dict:
if isinstance(full, dict):
return full
cmd = 'ssh-keygen -F "{0}" -f "{1}"'.format(hostname, full)
@ -718,7 +718,7 @@ def rm_known_host(user=None, hostname=None, config=None):
full = _get_known_hosts_file(config=config, user=user)
if type(full) == dict:
if isinstance(full, dict):
return full
if not os.path.isfile(full):
@ -793,7 +793,7 @@ def set_known_host(user=None,
full = _get_known_hosts_file(config=config, user=user)
if type(full) == dict:
if isinstance(full, dict):
return full
if key:
@ -935,7 +935,7 @@ def hash_known_hosts(user=None, config=None):
'''
full = _get_known_hosts_file(config=config, user=user)
if type(full) == dict:
if isinstance(full, dict):
return full
if not os.path.isfile(full):