forked from ungleich-public/cdist
Explorer tracks which type explorers have been transferred instad of Type
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
60509a49e2
commit
889e6c23cb
2 changed files with 4 additions and 4 deletions
|
@ -75,6 +75,7 @@ class Explorer(object):
|
||||||
}
|
}
|
||||||
if log.getEffectiveLevel() == logging.DEBUG:
|
if log.getEffectiveLevel() == logging.DEBUG:
|
||||||
self.env.update({'__debug': "yes" })
|
self.env.update({'__debug': "yes" })
|
||||||
|
self._type_explorers_transferred = []
|
||||||
|
|
||||||
### global
|
### global
|
||||||
|
|
||||||
|
@ -105,14 +106,14 @@ class Explorer(object):
|
||||||
def transfer_type_explorers(self, cdist_type):
|
def transfer_type_explorers(self, cdist_type):
|
||||||
"""Transfer the type explorers for the given type to the remote side."""
|
"""Transfer the type explorers for the given type to the remote side."""
|
||||||
if cdist_type.explorers:
|
if cdist_type.explorers:
|
||||||
if cdist_type.explorers_transferred:
|
if cdist_type.name in self._type_explorers_transferred:
|
||||||
log.debug("Skipping retransfer of type explorers for: %s", cdist_type)
|
log.debug("Skipping retransfer of type explorers for: %s", cdist_type)
|
||||||
else:
|
else:
|
||||||
source = os.path.join(self.local.type_path, cdist_type.explorer_path)
|
source = os.path.join(self.local.type_path, cdist_type.explorer_path)
|
||||||
destination = os.path.join(self.remote.type_path, cdist_type.explorer_path)
|
destination = os.path.join(self.remote.type_path, cdist_type.explorer_path)
|
||||||
self.remote.mkdir(destination)
|
self.remote.mkdir(destination)
|
||||||
self.remote.transfer(source, destination)
|
self.remote.transfer(source, destination)
|
||||||
cdist_type.explorers_transferred = True
|
self._type_explorers_transferred.append(cdist_type.name)
|
||||||
|
|
||||||
def transfer_object_parameters(self, cdist_object):
|
def transfer_object_parameters(self, cdist_object):
|
||||||
"""Transfer the parameters for the given object to the remote side."""
|
"""Transfer the parameters for the given object to the remote side."""
|
||||||
|
|
|
@ -54,6 +54,7 @@ class Type(object):
|
||||||
if not name in cls._instances:
|
if not name in cls._instances:
|
||||||
instance = super(Type, cls).__new__(cls)
|
instance = super(Type, cls).__new__(cls)
|
||||||
cls._instances[name] = instance
|
cls._instances[name] = instance
|
||||||
|
# return instance so __init__ is called
|
||||||
return cls._instances[name]
|
return cls._instances[name]
|
||||||
|
|
||||||
def __init__(self, base_path, name):
|
def __init__(self, base_path, name):
|
||||||
|
@ -67,8 +68,6 @@ class Type(object):
|
||||||
self.gencode_remote_path = os.path.join(self.name, "gencode-remote")
|
self.gencode_remote_path = os.path.join(self.name, "gencode-remote")
|
||||||
self.manifest_path = os.path.join(self.name, "manifest")
|
self.manifest_path = os.path.join(self.name, "manifest")
|
||||||
|
|
||||||
self.explorers_transferred = False
|
|
||||||
|
|
||||||
self.__explorers = None
|
self.__explorers = None
|
||||||
self.__required_parameters = None
|
self.__required_parameters = None
|
||||||
self.__optional_parameters = None
|
self.__optional_parameters = None
|
||||||
|
|
Loading…
Reference in a new issue