mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
module.run_command is intended to bypass the shell here, so can't do ">>"
This commit is contained in:
parent
7f38cff989
commit
cfabc2e28a
2 changed files with 9 additions and 1 deletions
|
@ -1089,6 +1089,12 @@ class AnsibleModule(object):
|
|||
self.fail_json(cmd=clean_args, rc=rc, stdout=out, stderr=err, msg=msg)
|
||||
return (rc, out, err)
|
||||
|
||||
def append_to_file(self, filename, str):
|
||||
filename = os.path.expandvars(os.path.expanduser(filename))
|
||||
fh = open(filename, 'a')
|
||||
fh.write(str)
|
||||
fh.close()
|
||||
|
||||
def pretty_bytes(self,size):
|
||||
ranges = (
|
||||
(1<<70L, 'ZB'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue