pvl.rrd.hosts: also support @domain for the collectd host
authorTero Marttila <terom@paivola.fi>
Sun, 07 Sep 2014 14:40:31 +0300
changeset 428 956b3d4918bb
parent 427 7dd5a33aa145
child 429 f1d0c5e0fdeb
pvl.rrd.hosts: also support @domain for the collectd host
pvl/rrd/hosts.py
--- a/pvl/rrd/hosts.py	Sun Sep 07 14:33:02 2014 +0300
+++ b/pvl/rrd/hosts.py	Sun Sep 07 14:40:31 2014 +0300
@@ -54,15 +54,19 @@
             else :
                 node = host
 
+            if '@' in host :
+                host, host_domain = host.split('@')
+            else:
+                host_domain = domain
+
             if '@' in node :
                 node, node_domain = node.split('@')
             else:
-                # as for collectd host
                 node_domain = domain
             
             # host has domain in collectd?
-            if domain :
-                host = hostjoin(host, domain)
+            if host_domain :
+                host = hostjoin(host, host_domain)
 
         if not parts :
             # keep host for following lines