diff options
Diffstat (limited to 'meta-openstack/classes/openstackchef_inc.bbclass')
| -rw-r--r-- | meta-openstack/classes/openstackchef_inc.bbclass | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/meta-openstack/classes/openstackchef_inc.bbclass b/meta-openstack/classes/openstackchef_inc.bbclass index 048fce6..91adb41 100644 --- a/meta-openstack/classes/openstackchef_inc.bbclass +++ b/meta-openstack/classes/openstackchef_inc.bbclass | |||
| @@ -184,12 +184,12 @@ def deploychef_make_startup_shutdown_list(d): | |||
| 184 | 184 | ||
| 185 | import os | 185 | import os |
| 186 | if d.getVar('INITSCRIPT_PACKAGES') or d.getVar('INITSCRIPT_NAME'): | 186 | if d.getVar('INITSCRIPT_PACKAGES') or d.getVar('INITSCRIPT_NAME'): |
| 187 | #script_list = bb.data.getVar('INITSCRIPT_PACKAGES', d , 1) | 187 | #script_list = d.getVar('INITSCRIPT_PACKAGES', 1) |
| 188 | script_list = d.getVar('INITSCRIPT_PACKAGES', True) or \ | 188 | script_list = d.getVar('INITSCRIPT_PACKAGES', True) or \ |
| 189 | d.getVar('INITSCRIPT_NAME', True) #Some package do not define INITSCRIPT_PACKAGES | 189 | d.getVar('INITSCRIPT_NAME', True) #Some package do not define INITSCRIPT_PACKAGES |
| 190 | msg="list of start/stop services: %s" % str(script_list) | 190 | msg="list of start/stop services: %s" % str(script_list) |
| 191 | bb.debug(2, msg) | 191 | bb.debug(2, msg) |
| 192 | base_dir = bb.data.getVar('CHEF_TEMPLATE_BASE', d, 1 ) | 192 | base_dir = d.getVar('CHEF_TEMPLATE_BASE', 1 ) |
| 193 | if not os.path.exists(base_dir): | 193 | if not os.path.exists(base_dir): |
| 194 | os.mkdir(base_dir) | 194 | os.mkdir(base_dir) |
| 195 | startup_file = os.path.join(base_dir, d.getVar('SRCNAME', True) +'-startup-list') | 195 | startup_file = os.path.join(base_dir, d.getVar('SRCNAME', True) +'-startup-list') |
| @@ -311,15 +311,15 @@ def deploychef_make_substitutions(d, sub_dict, attr_filename, sed_filename): | |||
| 311 | hFile.close() | 311 | hFile.close() |
| 312 | if False: | 312 | if False: |
| 313 | msg = "Cannot read/write to attributes file %s as expected:%s"\ | 313 | msg = "Cannot read/write to attributes file %s as expected:%s"\ |
| 314 | % (attr_filename, bb.data.getVar('FILE', d)) | 314 | % (attr_filename, d.getVar('FILE')) |
| 315 | bb.build.FuncFailed(msg) | 315 | bb.build.FuncFailed(msg) |
| 316 | else: | 316 | else: |
| 317 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ | 317 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ |
| 318 | % bb.data.getVar('FILE') | 318 | % d.getVar('FILE') |
| 319 | bb.error(msg) | 319 | bb.error(msg) |
| 320 | else: | 320 | else: |
| 321 | msg = "Null file names passsed to function %s %s "\ | 321 | msg = "Null file names passsed to function %s %s "\ |
| 322 | % (bb.data.getVar('FUNC',d), bb.data.getVar('FILE', d)) | 322 | % (d.getVar('FUNC'), d.getVar('FILE')) |
| 323 | bb.error(msg) | 323 | bb.error(msg) |
| 324 | 324 | ||
| 325 | 325 | ||
| @@ -338,7 +338,7 @@ def deploychef_make_templates( d, conf_tuple=tuple()): | |||
| 338 | 338 | ||
| 339 | if len(conf_tuple): | 339 | if len(conf_tuple): |
| 340 | import os, ast | 340 | import os, ast |
| 341 | base_dir = bb.data.getVar('CHEF_TEMPLATE_BASE', d, 1 ) | 341 | base_dir = d.getVar('CHEF_TEMPLATE_BASE', 1 ) |
| 342 | attr_file = os.path.join(base_dir, d.getVar('SRCNAME', True) + '-attributes.rb') | 342 | attr_file = os.path.join(base_dir, d.getVar('SRCNAME', True) + '-attributes.rb') |
| 343 | msg ="Default attributes saved to %s" % attr_file | 343 | msg ="Default attributes saved to %s" % attr_file |
| 344 | if os.path.exists(attr_file): | 344 | if os.path.exists(attr_file): |
| @@ -357,9 +357,9 @@ def deploychef_make_templates( d, conf_tuple=tuple()): | |||
| 357 | 357 | ||
| 358 | #Make the necessary susbstitutions using the default | 358 | #Make the necessary susbstitutions using the default |
| 359 | #substitutiin dictionary | 359 | #substitutiin dictionary |
| 360 | sub_dict = bb.data.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', d , 1) | 360 | sub_dict = d.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', 1) |
| 361 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | 361 | msg = "The variable %s is not set in %s as a dictionary as expected "\ |
| 362 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', bb.data.getVar('FILE', d)) | 362 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', d.getVar('FILE')) |
| 363 | if sub_dict: | 363 | if sub_dict: |
| 364 | #Safely retrieve our python data structure | 364 | #Safely retrieve our python data structure |
| 365 | sub_dict = ast.literal_eval(sub_dict) | 365 | sub_dict = ast.literal_eval(sub_dict) |
| @@ -371,11 +371,11 @@ def deploychef_make_templates( d, conf_tuple=tuple()): | |||
| 371 | raise bb.build.FuncFailed(msg) | 371 | raise bb.build.FuncFailed(msg) |
| 372 | #Make the necessary susbstitutions using auxilliary dictionary | 372 | #Make the necessary susbstitutions using auxilliary dictionary |
| 373 | #if provided by inheriting class | 373 | #if provided by inheriting class |
| 374 | sub_dict = bb.data.getVar('CHEF_SERVICES_CONF_SUBS', d , 1) | 374 | sub_dict = d.getVar('CHEF_SERVICES_CONF_SUBS', 1) |
| 375 | if sub_dict: | 375 | if sub_dict: |
| 376 | sub_dict = ast.literal_eval(sub_dict) | 376 | sub_dict = ast.literal_eval(sub_dict) |
| 377 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | 377 | msg = "The variable %s is not set in %s as a dictionary as expected "\ |
| 378 | % ('CHEF_SERVICES_CONF_SUB', bb.data.getVar('FILE', d)) | 378 | % ('CHEF_SERVICES_CONF_SUB', d.getVar('FILE')) |
| 379 | if type(sub_dict) is dict: | 379 | if type(sub_dict) is dict: |
| 380 | pass | 380 | pass |
| 381 | deploychef_make_substitutions(d, sub_dict, attr_file, file_name) | 381 | deploychef_make_substitutions(d, sub_dict, attr_file, file_name) |
| @@ -530,11 +530,11 @@ def deploychef_postinst_substitutions(d, sub_dict, postinst): | |||
| 530 | hFile.close() | 530 | hFile.close() |
| 531 | else: | 531 | else: |
| 532 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ | 532 | msg = "The substitution dictionary variable sub_dict is not set %s as expected "\ |
| 533 | % bb.data.getVar('FILE') | 533 | % d.getVar('FILE') |
| 534 | bb.build.FuncFailed(msg) | 534 | bb.build.FuncFailed(msg) |
| 535 | else: | 535 | else: |
| 536 | msg = "Null string passsed to function %s %s "\ | 536 | msg = "Null string passsed to function %s %s "\ |
| 537 | % (bb.data.getVar('FUNC',d), bb.data.getVar('FILE', d)) | 537 | % (d.getVar('FUNC'), d.getVar('FILE')) |
| 538 | bb.build.FuncFailed(msg) | 538 | bb.build.FuncFailed(msg) |
| 539 | return postinst | 539 | return postinst |
| 540 | 540 | ||
| @@ -565,9 +565,9 @@ def deploychef_update_package_postinsts(d): | |||
| 565 | overrides = d.getVar("OVERRIDES", True) | 565 | overrides = d.getVar("OVERRIDES", True) |
| 566 | msg = "%s The override variable is %s :\n %s " % (pkg, overrides, postinst) | 566 | msg = "%s The override variable is %s :\n %s " % (pkg, overrides, postinst) |
| 567 | bb.note(msg) | 567 | bb.note(msg) |
| 568 | sub_dict = bb.data.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', d , 1) | 568 | sub_dict = d.getVar('CHEF_SERVICES_DEFAULT_CONF_SUBS', 1) |
| 569 | msg = "The variable %s is not set in %s as a dictionary as expected "\ | 569 | msg = "The variable %s is not set in %s as a dictionary as expected "\ |
| 570 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', bb.data.getVar('FILE', d)) | 570 | % ('CHEF_SERVICES_DEFAULT_CONF_SUBS', d.getVar('FILE')) |
| 571 | if sub_dict: | 571 | if sub_dict: |
| 572 | import ast | 572 | import ast |
| 573 | #Safely retrieve our python data structure | 573 | #Safely retrieve our python data structure |
