-migration to CdistType error

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-02-13 10:41:12 +01:00
parent 0851af7d52
commit f12a83f3dd
3 changed files with 6 additions and 3 deletions

View file

@ -3,6 +3,9 @@
- double check verification
- adjust tests
- remove useless
ERROR: monitoring02: Code that raised the error:
--------------------------------------------------------------------------------
- __user

View file

@ -96,13 +96,13 @@ class Code(object):
self.env.update({'__debug': "yes" })
def _run_gencode(self, cdist_object, which):
cdist_type = cdist_object.type
cdist_type = cdist_object.cdist_type
script = os.path.join(self.local.type_path, getattr(cdist_type, 'gencode_%s_path' % which))
if os.path.isfile(script):
env = os.environ.copy()
env.update(self.env)
env.update({
'__type': cdist_object.type.absolute_path,
'__type': cdist_object.cdist_type.absolute_path,
'__object': cdist_object.absolute_path,
'__object_id': cdist_object.object_id,
'__object_name': cdist_object.name,

View file

@ -198,5 +198,5 @@ class ObjectTestCase(test.CdistTestCase):
other_name = '__first/man'
other_object = self.cdist_object.object_from_name(other_name)
self.assertTrue(isinstance(other_object, core.CdistObject))
self.assertEqual(other_object.type.name, '__first')
self.assertEqual(other_object.cdist_type.name, '__first')
self.assertEqual(other_object.object_id, 'man')