Merge pull request #7579 from javacruft/wip-systemd-escaping

systemd: correctly escape block device paths

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-02-11 08:42:50 -05:00
commit 88d251475b

View File

@ -3854,7 +3854,7 @@ def main_trigger(args):
LOG.debug("main_trigger: " + str(args))
if is_systemd() and not args.sync:
# http://www.freedesktop.org/software/systemd/man/systemd-escape.html
escaped_dev = args.dev.replace('-', '\\x2d')
escaped_dev = args.dev[1:].replace('-', '\\x2d')
service = 'ceph-disk@{dev}.service'.format(dev=escaped_dev)
LOG.info('systemd detected, triggering %s' % service)
command(