[pve-devel] [PATCH manager 1/3] Status: allow IPs and move properties to base class

Thomas Lamprecht t.lamprecht at proxmox.com
Fri May 20 12:07:38 CEST 2016


We only allowed servers with the dns-name format, as such status
server may often be in internal networks and with no hostname
(testing, small network so no dns, ...) do not limit the
configuration possibilities with no reason.

Also move the base property part to the base Status class, all
current plugins use server and port so no need for double
declaration of format/descriptions.

If a future plugin doesn't need them it can omit them by not
returning the respective properties in the options method
inherited by SectionConfig.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

I was a little unsure if I should have split this up in two patches,
moving of the param and changing dns-name to address..


 PVE/Status/Graphite.pm | 8 --------
 PVE/Status/Plugin.pm   | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm
index 407903b..c125c90 100644
--- a/PVE/Status/Graphite.pm
+++ b/PVE/Status/Graphite.pm
@@ -20,14 +20,6 @@ sub type {
 
 sub properties {
     return {
-	server => {
-	    type => 'string', format => 'dns-name',
-	    description => "server dns name",
-	},
-	port => {
-            type => 'integer',
-	    description => "network port",
-	},
 	path => {
             type => 'string', format => 'graphite-path',
 	    description => "root graphite path (ex: proxmox.mycluster.mykey)",
diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm
index c11b6cc..070467c 100644
--- a/PVE/Status/Plugin.pm
+++ b/PVE/Status/Plugin.pm
@@ -26,6 +26,14 @@ my $defaultData = {
 	    type => 'boolean',
 	    optional => 1,
 	},
+	server => {
+	    type => 'string', format => 'address',
+	    description => "server dns name or IP address",
+	},
+	port => {
+	    type => 'integer',
+	    description => "server network port",
+	},
     },
 };
 
-- 
2.1.4





More information about the pve-devel mailing list