use constant instead of string for .cdist

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-06 13:02:08 +02:00
parent 4de5f6f58e
commit 41ab7390db

View file

@ -22,6 +22,7 @@
import os import os
import cdist import cdist
import cdist.path
class Object(object): class Object(object):
@ -72,7 +73,7 @@ class Object(object):
"""Return a list of object names""" """Return a list of object names"""
for path, dirs, files in os.walk(cls.base_dir()): for path, dirs, files in os.walk(cls.base_dir()):
# FIXME: use constant instead of string # FIXME: use constant instead of string
if '.cdist' in dirs: if cdist.path.DOT_CDIST in dirs:
yield os.path.relpath(path, cls.base_dir()) yield os.path.relpath(path, cls.base_dir())
def __init__(self, type, object_id=None, parameter=None, requirements=None): def __init__(self, type, object_id=None, parameter=None, requirements=None):
@ -90,7 +91,7 @@ class Object(object):
return os.path.join( return os.path.join(
self.base_dir(), self.base_dir(),
self.qualified_name, self.qualified_name,
'.cdist' cdist.path.DOT_CDIST
) )
@property @property