Skip to content

Commit

Permalink
Fix sls backup creation as directory with spacecmd (bsc#1230745)
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhestkov committed Sep 26, 2024
1 parent 19e06ae commit 8166449
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spacecmd/src/spacecmd/configchannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,13 @@ def do_configchannel_backup(self, args):

fh.write('selinux_ctx = %s\n' % details.get('selinux_ctx'))

if details.get('type') == 'file':
if details.get("type") in ("file", "sls"):
dumpdir = os.path.dirname(dumpfile)

if not os.path.isdir(dumpdir):
os.makedirs(dumpdir)

if details.get('type') == 'file':
if details.get("type") in ("file", "sls"):
fh.write('sha256 = %s\n' % details.get('sha256'))
fh.write('binary = %s\n' % details.get('binary'))
of = open(dumpfile, 'w')
Expand Down

0 comments on commit 8166449

Please sign in to comment.