mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
client: fix script execution
if __name__ == "__main__" should be first instead of try block. We want execute it only when file was executed as script https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
1f65c07524
commit
8cbbb53591
@ -257,14 +257,15 @@ def main():
|
||||
|
||||
return rval
|
||||
|
||||
try:
|
||||
if __name__ == "__main__":
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
sys.exit(main())
|
||||
except KeyboardInterrupt:
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
except RuntimeError as e:
|
||||
except RuntimeError as e:
|
||||
sys.exit(e)
|
||||
finally:
|
||||
finally:
|
||||
try:
|
||||
os.remove(client.CCACHE_FILE)
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user