summaryrefslogtreecommitdiffstats
path: root/meta-openstack/classes/monitor.bbclass
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2016-12-19 15:10:37 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-12-20 17:29:25 -0500
commitab7fc08536aafa90465c1483dfdf9cb4d95bd0b3 (patch)
treeea7ac22caf8e778f4cd590414ee6e2977fd5fe94 /meta-openstack/classes/monitor.bbclass
parent39e481c1e84ae87e45a84dce2ed57b25fa771c10 (diff)
downloadmeta-cloud-services-ab7fc08536aafa90465c1483dfdf9cb4d95bd0b3.tar.gz
housekeeping: drop usage of bb.data.getVar()
Similar to oe-core commit 2864ff6a4b3c3f9b3bbb6d2597243cc5d3715939 the bb.data.getVar() have been deprecated for enough time now that it has been removed. We need to switch to the new getVar() to get things working again. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/classes/monitor.bbclass')
-rw-r--r--meta-openstack/classes/monitor.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta-openstack/classes/monitor.bbclass b/meta-openstack/classes/monitor.bbclass
index a959f09..e916137 100644
--- a/meta-openstack/classes/monitor.bbclass
+++ b/meta-openstack/classes/monitor.bbclass
@@ -12,7 +12,7 @@ addtask monitor_clean before do_clean
12def copy_check_files(d, check_var_name, src, dest): 12def copy_check_files(d, check_var_name, src, dest):
13 import shutil 13 import shutil
14 14
15 mon_checks = bb.data.getVar(check_var_name, d, 1) 15 mon_checks = d.getVar(check_var_name, 1)
16 if mon_checks != None: 16 if mon_checks != None:
17 if not os.path.exists(dest): 17 if not os.path.exists(dest):
18 os.makedirs(dest) 18 os.makedirs(dest)
@@ -29,9 +29,9 @@ python do_monitor_install() {
29 bb.debug(1, 'OpenStack monitoring feature is disabled, skipping do_monitor_install') 29 bb.debug(1, 'OpenStack monitoring feature is disabled, skipping do_monitor_install')
30 return 30 return
31 31
32 mon_dir = bb.data.getVar('MONITOR_STAGING_DIR', d, 1) 32 mon_dir = d.getVar('MONITOR_STAGING_DIR', 1)
33 mon_services_dir = bb.data.getVar('MONITOR_STAGING_SERVICES_DIR', d, 1) 33 mon_services_dir = d.getVar('MONITOR_STAGING_SERVICES_DIR', 1)
34 mon_checks_dir = bb.data.getVar('MONITOR_STAGING_CHECKS_DIR', d, 1) 34 mon_checks_dir = d.getVar('MONITOR_STAGING_CHECKS_DIR', 1)
35 if not os.path.exists(mon_dir): 35 if not os.path.exists(mon_dir):
36 os.makedirs(mon_dir) 36 os.makedirs(mon_dir)
37 if not os.path.exists(mon_services_dir): 37 if not os.path.exists(mon_services_dir):
@@ -41,13 +41,13 @@ python do_monitor_install() {
41 workdir = d.getVar('WORKDIR', True) 41 workdir = d.getVar('WORKDIR', True)
42 42
43 # Process monitor SERVICE catagory 43 # Process monitor SERVICE catagory
44 mon_service_pkgs = bb.data.getVar('MONITOR_SERVICE_PACKAGES', d, 1) 44 mon_service_pkgs = d.getVar('MONITOR_SERVICE_PACKAGES', 1)
45 if mon_service_pkgs != None: 45 if mon_service_pkgs != None:
46 for pkg in mon_service_pkgs.split(): 46 for pkg in mon_service_pkgs.split():
47 f_name = os.path.join(mon_services_dir, pkg + '.service') 47 f_name = os.path.join(mon_services_dir, pkg + '.service')
48 if os.path.exists(f_name): 48 if os.path.exists(f_name):
49 os.remove(f_name) 49 os.remove(f_name)
50 data = bb.data.getVar('MONITOR_SERVICE_' + pkg, d, 1) 50 data = d.getVar('MONITOR_SERVICE_' + pkg, 1)
51 if data != None: 51 if data != None:
52 f = open(f_name, 'w') 52 f = open(f_name, 'w')
53 f.write(d.getVar('MONITOR_SERVICE_' + pkg)) 53 f.write(d.getVar('MONITOR_SERVICE_' + pkg))
@@ -62,14 +62,14 @@ python do_monitor_install() {
62python do_monitor_clean() { 62python do_monitor_clean() {
63 import shutil 63 import shutil
64 64
65 mon_dir = bb.data.getVar('MONITOR_STAGING_DIR', d, 1) 65 mon_dir = d.getVar('MONITOR_STAGING_DIR', 1)
66 mon_services_dir = bb.data.getVar('MONITOR_STAGING_SERVICES_DIR', d, 1) 66 mon_services_dir = d.getVar('MONITOR_STAGING_SERVICES_DIR', 1)
67 mon_checks_dir = bb.data.getVar('MONITOR_STAGING_CHECKS_DIR', d, 1) 67 mon_checks_dir = d.getVar('MONITOR_STAGING_CHECKS_DIR', 1)
68 if not os.path.exists(mon_dir): 68 if not os.path.exists(mon_dir):
69 return 69 return
70 70
71 # Clean up monitor SERVICE catagory 71 # Clean up monitor SERVICE catagory
72 mon_service_pkgs = bb.data.getVar('MONITOR_SERVICE_PACKAGES', d, 1) 72 mon_service_pkgs = d.getVar('MONITOR_SERVICE_PACKAGES', 1)
73 if mon_service_pkgs != None and os.path.exists(mon_services_dir): 73 if mon_service_pkgs != None and os.path.exists(mon_services_dir):
74 for pkg in mon_service_pkgs.split(): 74 for pkg in mon_service_pkgs.split():
75 f_name = os.path.join(mon_services_dir, pkg + '.service') 75 f_name = os.path.join(mon_services_dir, pkg + '.service')
@@ -80,7 +80,7 @@ python do_monitor_clean() {
80 packages = (d.getVar('PACKAGES', True) or "").split() 80 packages = (d.getVar('PACKAGES', True) or "").split()
81 if len(packages) >= 1 and os.path.exists(mon_checks_dir): 81 if len(packages) >= 1 and os.path.exists(mon_checks_dir):
82 for pkg in packages: 82 for pkg in packages:
83 if bb.data.getVar('MONITOR_CHECKS_' + pkg, d, 1) != None: 83 if d.getVar('MONITOR_CHECKS_' + pkg, 1) != None:
84 shutil.rmtree(mon_checks_dir + "/" + pkg, True) 84 shutil.rmtree(mon_checks_dir + "/" + pkg, True)
85} 85}
86 86