mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 13:59:09 -07: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
|
#!/usr/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import stat
|
import stat
|
||||||
|
@ -19,7 +20,8 @@ from ansible.utils.vault import read_vault_file
|
||||||
from ansible.vars import VariableManager
|
from ansible.vars import VariableManager
|
||||||
|
|
||||||
# Implement an ansible.utils.warning() function later
|
# 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:]))
|
sys.exit(main(sys.argv[1:]))
|
||||||
except AnsibleError, e:
|
except AnsibleError, e:
|
||||||
#display("ERROR: %s" % e, color='red', stderr=True)
|
#display("ERROR: %s" % e, color='red', stderr=True)
|
||||||
print e
|
print(e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except KeyboardInterrupt, ke:
|
except KeyboardInterrupt, ke:
|
||||||
#display("ERROR: interrupted", color='red', stderr=True)
|
#display("ERROR: interrupted", color='red', stderr=True)
|
||||||
print "keyboard interrupt"
|
print("keyboard interrupt")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue