[apparmor] [patch 4/4] utils/aa-unconfined: whitespace cleanups for pep8 consistency.
Steve Beattie
steve at nxnw.org
Fri Dec 30 07:24:58 UTC 2016
This is what this patch looks like when diff'ed ignoring spacing
changes:
$ quilt diff | diffstat
aa-unconfined | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
$ quilt diff --diff 'diff -uw'
$
Signed-off-by: Steve Beattie <steve at nxnw.org>
---
utils/aa-unconfined | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Index: b/utils/aa-unconfined
===================================================================
--- a/utils/aa-unconfined
+++ b/utils/aa-unconfined
@@ -114,15 +114,15 @@ else:
for pid in sorted(map(int, pids)):
try:
- prog = os.readlink("/proc/%s/exe"%pid)
+ prog = os.readlink("/proc/%s/exe" % pid)
except OSError:
continue
attr = None
- if os.path.exists("/proc/%s/attr/current"%pid):
- with apparmor.common.open_file_read("/proc/%s/attr/current"%pid) as current:
+ if os.path.exists("/proc/%s/attr/current" % pid):
+ with apparmor.common.open_file_read("/proc/%s/attr/current" % pid) as current:
for line in current:
line = line.strip()
- if line.endswith(' (complain)', 1) or line.endswith(' (enforce)', 1): # enforce at least one char as profile name
+ if line.endswith(' (complain)', 1) or line.endswith(' (enforce)', 1): # enforce at least one char as profile name
attr = line
pname = None
@@ -131,7 +131,7 @@ for pid in sorted(map(int, pids)):
cmdline = cmd.readlines()[0]
pname = cmdline.split("\0")[0]
if '/' in pname and pname != prog:
- pname = "(%s)"% pname
+ pname = "(%s)" % pname
else:
pname = ""
regex_interpreter = re.compile(r"^(/usr)?/bin/(python|perl|bash|dash|sh)$")
@@ -140,17 +140,17 @@ for pid in sorted(map(int, pids)):
cmdline = re.sub(r"\x00", " ", cmdline)
cmdline = re.sub(r"\s+$", "", cmdline).strip()
- ui.UI_Info(_("%(pid)s %(program)s (%(commandline)s) not confined") % { 'pid': pid, 'program': prog, 'commandline': cmdline })
+ ui.UI_Info(_("%(pid)s %(program)s (%(commandline)s) not confined") % {'pid': pid, 'program': prog, 'commandline': cmdline})
else:
if pname and pname[-1] == ')':
pname = ' ' + pname
- ui.UI_Info(_("%(pid)s %(program)s%(pname)s not confined") % { 'pid': pid, 'program': prog, 'pname': pname })
+ ui.UI_Info(_("%(pid)s %(program)s%(pname)s not confined") % {'pid': pid, 'program': prog, 'pname': pname})
else:
if regex_interpreter.search(prog):
cmdline = re.sub(r"\0", " ", cmdline)
cmdline = re.sub(r"\s+$", "", cmdline).strip()
- ui.UI_Info(_("%(pid)s %(program)s (%(commandline)s) confined by '%(attribute)s'") % { 'pid': pid, 'program': prog, 'commandline': cmdline, 'attribute': attr })
+ ui.UI_Info(_("%(pid)s %(program)s (%(commandline)s) confined by '%(attribute)s'") % {'pid': pid, 'program': prog, 'commandline': cmdline, 'attribute': attr})
else:
if pname and pname[-1] == ')':
pname = ' ' + pname
- ui.UI_Info(_("%(pid)s %(program)s%(pname)s confined by '%(attribute)s'") % { 'pid': pid, 'program': prog, 'pname': pname, 'attribute': attr })
+ ui.UI_Info(_("%(pid)s %(program)s%(pname)s confined by '%(attribute)s'") % {'pid': pid, 'program': prog, 'pname': pname, 'attribute': attr})
More information about the AppArmor
mailing list