mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add support for --output-file-append
. Fixes #15074.
This commit is contained in:
parent
75c8e1839e
commit
1e2460e504
@ -987,6 +987,13 @@ class OutputOptionsMixIn(object):
|
||||
default=None,
|
||||
help='Write the output to the specified file'
|
||||
)
|
||||
group.add_option(
|
||||
'--out-file-append', '--output-file-append',
|
||||
action='store_true',
|
||||
dest='output_file_append',
|
||||
default=False,
|
||||
help='Append the output to the specified file'
|
||||
)
|
||||
group.add_option(
|
||||
'--no-color', '--no-colour',
|
||||
default=False,
|
||||
@ -1015,7 +1022,7 @@ class OutputOptionsMixIn(object):
|
||||
self.selected_output_option = self.options.output
|
||||
|
||||
def process_output_file(self):
|
||||
if self.options.output_file is not None:
|
||||
if self.options.output_file is not None and self.options.output_file_append is False:
|
||||
if os.path.isfile(self.options.output_file):
|
||||
try:
|
||||
os.remove(self.options.output_file)
|
||||
|
Loading…
Reference in New Issue
Block a user