From 2492d51f6f5d0741096344e13a3a2c54c782d36a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 13 Feb 2012 07:56:37 +0100 Subject: [PATCH] make object_from_name() better readable Signed-off-by: Nico Schottelius --- lib/cdist/core/cdist_object.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/cdist/core/cdist_object.py b/lib/cdist/core/cdist_object.py index e7ea7a9f..b6bf0903 100644 --- a/lib/cdist/core/cdist_object.py +++ b/lib/cdist/core/cdist_object.py @@ -138,10 +138,15 @@ class CdistObject(object): .object_from_name('__other/object') -> """ - type_path = self.cdist_type.base_path + base_path = self.base_path + type_path = self.cdist_type.base_path + type_name, object_id = self.split_name(object_name) - return self.__class__(self.cdist_type.__class__(type_path, type_name), base_path, object_id=object_id) + + cdist_type = self.cdist_type.__class__(type_path, type_name) + + return self.__class__(cdist_type, base_path, object_id=object_id) def __repr__(self): return '' % self.name