Skip to content

Commit

Permalink
Merge pull request #1050 from grycap/ssh_conn
Browse files Browse the repository at this point in the history
Ssh conn
  • Loading branch information
micafer authored Jul 28, 2020
2 parents 67d58cb + ef14a4e commit 7fe8009
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 2 additions & 4 deletions IM/ConfManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,7 @@ def generate_playbook(self, vm, ctxt_elem, tmp_dir):
"""
recipe_files = []

conf_filename = tmp_dir + "/" + ctxt_elem.configure + \
"_" + ctxt_elem.system + "_task.yml"
conf_filename = tmp_dir + "/" + ctxt_elem.configure + "_" + ctxt_elem.system + "_task.yml"
if not os.path.isfile(conf_filename):
configure = self.inf.radl.get_configure_by_name(ctxt_elem.configure)
conf_content = self.add_ansible_header(vm.getOS().lower())
Expand Down Expand Up @@ -996,8 +995,7 @@ def generate_playbooks_and_hosts(self):
if self.inf.radl.configures:
for elem in self.inf.radl.configures:
if elem is not None and not os.path.isfile(tmp_dir + "/" + elem.name + ".yml"):
conf_out = open(
tmp_dir + "/" + elem.name + ".yml", 'w')
conf_out = open(tmp_dir + "/" + elem.name + ".yml", 'w')
conf_out.write(elem.recipes)
conf_out.write("\n\n")
conf_out.close()
Expand Down
8 changes: 3 additions & 5 deletions IM/VirtualMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,9 @@ def get_ctxt_log(self, remote_dir, ssh, delete=False):
self.log_debug("Get File: " + remote_dir + '/ctxt_agent.log')
ssh.sftp_get(remote_dir + '/ctxt_agent.log', tmp_dir + '/ctxt_agent.log')
with open(tmp_dir + '/ctxt_agent.log') as f:
conf_out = f.read()

# Remove problematic chars
conf_out = str("".join(list(filter(lambda x: x in string.printable,
conf_out))).encode("ascii", "replace").decode("utf-8"))
# Read removing problematic chars
conf_out = str("".join(list(filter(lambda x: x in string.printable,
f.read()))).encode("ascii", "replace").decode("utf-8"))
try:
if delete:
ssh.sftp_remove(remote_dir + '/ctxt_agent.log')
Expand Down
6 changes: 5 additions & 1 deletion changelog
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,8 @@ IM 1.9.2:
IM 1.9.3:
* Support for ex_tenant_domain_id due to change in libcloud.
* Error getting EC2 instance types.
* Error deleting SGs in some OpenStack sites.
* Error deleting SGs in some OpenStack sites.

IM 1.9.4:
* Reduce the number of SSH logins.
* Fix python 3 issues.

0 comments on commit 7fe8009

Please sign in to comment.