On 25.11.19 17:24, Ralf Ramsauer wrote:
Python 3.8 complains:
GEN /home/ralf/jailhouse/tools/jailhouse-config-collect
/home/ralf/jailhouse/tools/jailhouse-config-create:230: SyntaxWarning: "is" with a
literal. Did you mean "=="?
if ((options.root is '/') and (os.geteuid() is not 0)):
/home/ralf/jailhouse/tools/jailhouse-config-create:230: SyntaxWarning: "is not" with a
literal. Did you mean "!="?
if ((options.root is '/') and (os.geteuid() is not 0)):
Fix it. And remove some parentheses.
Signed-off-by: Ralf Ramsauer <[email protected]>
---
tools/jailhouse-config-create | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
index 46de3f65..e746dbf1 100755
--- a/tools/jailhouse-config-create
+++ b/tools/jailhouse-config-create
@@ -227,7 +227,7 @@ if options.generate_collector:
f.close()
sys.exit(0)
-if ((options.root is '/') and (os.geteuid() is not 0)):
+if options.root == '/' and os.geteuid() != 0:
print('ERROR: You have to be root to work on "/"!', file=sys.stderr)
sys.exit(1)
Applied, thanks.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/5d7ed362-0d7c-eb9b-1d8b-64c2e055d2e9%40siemens.com.