diff options
Diffstat (limited to 'meta-openstack/classes/monitor.bbclass')
| -rw-r--r-- | meta-openstack/classes/monitor.bbclass | 22 |
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 | |||
| 12 | def copy_check_files(d, check_var_name, src, dest): | 12 | def 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() { | |||
| 62 | python do_monitor_clean() { | 62 | python 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 | ||
