mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
A little py3 compat, side effect of making this work under profile
This commit is contained in:
parent
bfae708bbf
commit
ac6b7045db
1 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import stat
|
||||
|
@ -19,7 +20,8 @@ from ansible.utils.vault import read_vault_file
|
|||
from ansible.vars import VariableManager
|
||||
|
||||
# Implement an ansible.utils.warning() function later
|
||||
warning = getattr(__builtins__, 'print')
|
||||
def warning(*args, **kwargs):
|
||||
print(*args, **kwargs)
|
||||
|
||||
#---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -136,10 +138,10 @@ if __name__ == "__main__":
|
|||
sys.exit(main(sys.argv[1:]))
|
||||
except AnsibleError, e:
|
||||
#display("ERROR: %s" % e, color='red', stderr=True)
|
||||
print e
|
||||
print(e)
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt, ke:
|
||||
#display("ERROR: interrupted", color='red', stderr=True)
|
||||
print "keyboard interrupt"
|
||||
print("keyboard interrupt")
|
||||
sys.exit(1)
|
||||
|
||||
|
|
Loading…
Reference in a new issue