Add support for shell lib directory path
This commit is contained in:
parent
e1c08c25b5
commit
bcdfc0eaa3
7 changed files with 24 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ gencode-local
|
|||
__type: full qualified path to the type's dir
|
||||
__files: full qualified path to the files dir
|
||||
__target_host_tags: comma spearated list of host tags
|
||||
__lib: full qualified path to the lib dir
|
||||
|
||||
returns: string containing the generated code or None
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ gencode-remote
|
|||
__type: full qualified path to the type's dir
|
||||
__files: full qualified path to the files dir
|
||||
__target_host_tags: comma spearated list of host tags
|
||||
__lib: full qualified path to the lib dir
|
||||
|
||||
returns: string containing the generated code or None
|
||||
|
||||
|
|
@ -107,6 +109,7 @@ class Code(object):
|
|||
'__target_fqdn': self.target_host[2],
|
||||
'__global': self.local.base_path,
|
||||
'__files': self.local.files_path,
|
||||
'__lib': self.local.lib_path,
|
||||
'__target_host_tags': self.local.target_host_tags,
|
||||
'__cdist_log_level': util.log_level_env_var_val(local.log),
|
||||
'__cdist_log_level_name': util.log_level_name_env_var_val(
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ common:
|
|||
== local.type_path
|
||||
__files: full qualified path to the files dir
|
||||
__target_host_tags: comma spearated list of host tags
|
||||
__lib: full qualified path to the lib dir
|
||||
|
||||
initial manifest is:
|
||||
script: full qualified path to the initial manifest
|
||||
|
|
@ -111,6 +112,7 @@ class Manifest(object):
|
|||
'__target_hostname': self.target_host[1],
|
||||
'__target_fqdn': self.target_host[2],
|
||||
'__files': self.local.files_path,
|
||||
'__lib': self.local.lib_path,
|
||||
'__target_host_tags': self.local.target_host_tags,
|
||||
'__cdist_log_level': util.log_level_env_var_val(self.log),
|
||||
'__cdist_log_level_name': util.log_level_name_env_var_val(
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import cdist.message
|
|||
from cdist import core
|
||||
import cdist.exec.util as util
|
||||
|
||||
CONF_SUBDIRS_LINKED = ["explorer", "files", "manifest", "type", ]
|
||||
CONF_SUBDIRS_LINKED = ["explorer", "files", "manifest", "type", "lib", ]
|
||||
|
||||
|
||||
class Local(object):
|
||||
|
|
@ -133,6 +133,7 @@ class Local(object):
|
|||
os.path.join(self.manifest_path, "init"))
|
||||
|
||||
self.type_path = os.path.join(self.conf_path, "type")
|
||||
self.lib_path = os.path.join(self.conf_path, "lib")
|
||||
|
||||
def _init_object_marker(self):
|
||||
self.object_marker_file = os.path.join(self.base_path, "object_marker")
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class Shell(object):
|
|||
'__manifest': self.local.manifest_path,
|
||||
'__explorer': self.local.global_explorer_path,
|
||||
'__files': self.local.files_path,
|
||||
'__lib': self.local.lib_path,
|
||||
'__target_host_tags': self.local.target_host_tags,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ class CodeTestCase(test.CdistTestCase):
|
|||
self.cdist_object.object_id)
|
||||
self.assertEqual(output_dict['__object_name'], self.cdist_object.name)
|
||||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__lib'], self.local.lib_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'],
|
||||
|
|
@ -129,6 +130,7 @@ class CodeTestCase(test.CdistTestCase):
|
|||
self.cdist_object.object_id)
|
||||
self.assertEqual(output_dict['__object_name'], self.cdist_object.name)
|
||||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__lib'], self.local.lib_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'],
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ class ManifestTestCase(test.CdistTestCase):
|
|||
self.local.type_path)
|
||||
self.assertEqual(output_dict['__manifest'], self.local.manifest_path)
|
||||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__lib'], self.local.lib_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'],
|
||||
|
|
@ -140,6 +141,7 @@ class ManifestTestCase(test.CdistTestCase):
|
|||
self.assertEqual(output_dict['__object_id'], cdist_object.object_id)
|
||||
self.assertEqual(output_dict['__object_name'], cdist_object.name)
|
||||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__lib'], self.local.lib_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue