]> git.proxmox.com Git - pve-manager.git/commitdiff
ceph api: Make systemd unit type suffix optional
authorDominic Jäger <d.jaeger@proxmox.com>
Mon, 17 Feb 2020 11:28:57 +0000 (12:28 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Feb 2020 12:08:21 +0000 (13:08 +0100)
To (re)start and stop Ceph services the API calls systemd units using the
function ceph_service_cmd.  If unspecified, this function assumes the type
".target" for a unit. By making the unit type suffix in the API optional, it
can make use of this assumption.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
PVE/API2/Ceph.pm

index e209782552a4077a86e66fd939bdf7811c88e148..391382f8c1bee2ee1231f8d308057111e61cc4ca 100644 (file)
@@ -424,7 +424,7 @@ __PACKAGE__->register_method ({
                type => 'string',
                optional => 1,
                default => 'ceph.target',
-               pattern => '(ceph|mon|mds|osd|mgr)\.[A-Za-z0-9\-]{1,32}',
+               pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
            },
        },
     },
@@ -475,7 +475,7 @@ __PACKAGE__->register_method ({
                type => 'string',
                optional => 1,
                default => 'ceph.target',
-               pattern => '(ceph|mon|mds|osd|mgr)\.[A-Za-z0-9\-]{1,32}',
+               pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
            },
        },
     },
@@ -526,7 +526,7 @@ __PACKAGE__->register_method ({
                type => 'string',
                optional => 1,
                default => 'ceph.target',
-               pattern => '(mon|mds|osd|mgr)\.[A-Za-z0-9\-]{1,32}',
+               pattern => '(mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
            },
        },
     },