Sandro Bonazzola has posted comments on this change.

Change subject: tools: Print selinux context of files in hosts.
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

....................................................
File src/__main__.py
Line 677:             self.caller.call('%(ssh_cmd)s "/bin/rm %(path)s*"')
Line 678:             stdout = self.caller.call('%(ssh_cmd)s "/bin/ls -lRZ /etc 
/var /rhev"')
Line 679:             self.configuration["selinux_dir"] = os.path.join(
Line 680:                 self.configuration.get("hypervisor_dir"),
Line 681:                 "selinux", "ls_-lRZ_" + 
os.path.basename(self.configuration.get("path"))
self.configuration['selinux_dir'] = os.path.join(
    self.configuration.get('hypervisor_dir'),
    'selinux',
)
os.mkdir(self.configuration['selinux_dir'])
with open(
   os.path.join(
       self.configuration['selinux_dir'],
       'ls_-lRZ_etc_var_rhev',
    ),
    'w',
) as f:
    f.write(stdout)

This will create the file:
'{local_tmp_dir}/log-collector-data/{hostname}/selinux/ls_-lRZ_etc_var_rhev'
that will be in the log-collector archive as  
log-collector-data/{hostname}/selinux/ls_-lRZ_etc_var_rhev.

If you want to add the file to the hypervisor sosreport you've to open the 
tarfile '%(hypervisor_dir)s/%(archive_name)s' and add the file. But I think it 
is enough having it in log-collector-data/{hostname}/selinux directory.
Line 682:             os.mkdir(self.configuration["selinux_dir"])
Line 683:             self.caller.call(
Line 684:                 '%(scp_cmd)s:%(stdout)s 
self.configuration["selinux_dir"]'
Line 685:             )


-- 
To view, visit http://gerrit.ovirt.org/17542
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53eddd683edc38502e881081b4bd35e15dae3a69
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-log-collector
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Keith Robertson <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to