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.jae...@proxmox.com>
---
 PVE/API2/Ceph.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index e2097825..391382f8 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -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})?',
            },
        },
     },
-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to