From e32ba9faff25661b74da47d3d84bada126150c91 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Fri, 13 Oct 2017 15:18:16 -0700 Subject: resource: move make_resource_profile to ResourceProfile move factory method from Collector to ResourceProfile Change-Id: I1ddf3cffed7a3b2d45aa9cbffd3c0a5925c325d6 Signed-off-by: Ross Brattain --- yardstick/network_services/nfvi/resource.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'yardstick/network_services/nfvi') diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py index dea754d8b..5b96aaf29 100644 --- a/yardstick/network_services/nfvi/resource.py +++ b/yardstick/network_services/nfvi/resource.py @@ -82,6 +82,18 @@ class ResourceProfile(object): self.mgmt = mgmt self.connection = ssh.AutoConnectSSH.from_node(mgmt) + @classmethod + def make_from_node(cls, node, timeout): + # node dict works as mgmt dict + # don't need port names, there is no way we can + # tell what port is used on the compute node + collectd_options = node["collectd"] + plugins = collectd_options.get("plugins", {}) + interval = collectd_options.get("interval") + + # use default cores = None to MatchAllCores + return cls(node, plugins=plugins, interval=interval, timeout=timeout) + def check_if_sa_running(self, process): """ verify if system agent is running """ try: -- cgit 1.2.3-korg