Since gatherkeys now uses distro.conn.remote_module.shortname()
We need to mock this also.
Signed-off-by: Owen Synge <osynge@suse.com>
def get_file(self, path):
return self.get_file_result
+ def shortname(self):
+ hostname_split = self.longhostname.split('.')
+ return hostname_split[0]
class mock_conn(object):
def __init__(self):
output = mock_distro()
mon_keyring = '[mon.]\nkey = %s\ncaps mon = allow *\n' % new.generate_auth_key()
output.conn.remote_module.get_file_result = mon_keyring
+ output.conn.remote_module.longhostname = host
return output
def mock_hosts_get_file_key_content_none(host, **kwargs):
output = mock_distro()
output.conn.remote_module.get_file_result = None
+ output.conn.remote_module.longhostname = host
return output