]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix 2> syntax in unit.run 39166/head
authorSage Weil <sage@newdream.net>
Thu, 21 Jan 2021 15:10:51 +0000 (09:10 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Fri, 29 Jan 2021 15:02:17 +0000 (16:02 +0100)
We need a space between the command (which ends with a container name)
and the 2> or else the 2 is considered part of the command.  E.g.,

! /usr/bin/podman rm -f ceph-a9a8c7ee-5b72-11eb-8f93-001a4aab830c-mon.a2> /dev/null

Fixes: 1bed46e4b0094863a119df59c6ae5f254c2e211d
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit ce4743f72e6c7eea9514b8c9b6c20309fea5d455)

Conflicts:
src/cephadm/cephadm

src/cephadm/cephadm

index d2cf05da82f2126bbcbb7617ae7ef8a8d649601e..684b4522932628df604893e2cc2351aaefa81c4b 100755 (executable)
@@ -2192,10 +2192,10 @@ def _write_container_cmd_to_bash(file_obj, container, comment=None, background=F
         # unit file, makes it easier to read and grok.
         file_obj.write('# ' + comment + '\n')
     # Sometimes, adding `--rm` to a run_cmd doesn't work. Let's remove the container manually
-    file_obj.write('! '+ ' '.join(container.rm_cmd()) + '2> /dev/null\n')
+    file_obj.write('! '+ ' '.join(container.rm_cmd()) + ' 2> /dev/null\n')
     # Sometimes, `podman rm` doesn't find the container. Then you'll have to add `--storage`
     if 'podman' in container_path:
-        file_obj.write('! '+ ' '.join(container.rm_cmd(storage=True)) + '2> /dev/null\n')
+        file_obj.write('! '+ ' '.join(container.rm_cmd(storage=True)) + ' 2> /dev/null\n')
 
     # container run command
     file_obj.write(' '.join(container.run_cmd()) + (' &' if background else '') + '\n')