mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
modjk & ssh modules: type(X) is Y ==> isinstance(X, Y)
This commit is contained in:
parent
263ed1ad90
commit
f3830b1c44
@ -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:
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user