def __init__(self,delegate): self.__dict__["_ci"] = delegate # Create control task methods (if proxies exposed) try: descriptor = DescriptorRegistry.getDescriptor(delegate.type) controlTasks = descriptor.controlTasks for task in controlTasks: self.__dict__[task.name] = lambda: deployit.executeControlTask(task.name, self._ci) except: pass
def __init__(self, delegate): self.__dict__["_ci"] = delegate # Create control task methods (if proxies exposed) try: descriptor = DescriptorRegistry.getDescriptor(delegate.type) controlTasks = descriptor.controlTasks for task in controlTasks: self.__dict__[task.name] = lambda: deployit.executeControlTask( task.name, self._ci) except: pass
def convertToDeployable(deployedId, pkgId): deployed = repository.read(deployedId) deployedDescriptor = DescriptorRegistry.getDescriptor(deployed.type) if (deployedDescriptor.type.instanceOf(Type.valueOf("udm.DeployedArtifact"))): print "Cannot convert artifact deployed [%s]. Ignoring " %(deployable.id) return None deployableDescriptor = DescriptorRegistry.getDescriptor(deployedDescriptor.deployableType) deployable = factory.configurationItem("%s/%s" % (pkgId, deployed.name), str(deployableDescriptor.type)) if (repository.exists(deployable.id)): print "[%s] already exists. Ignoring " %(deployable.id) return None print "Converting [%s] to type [%s]" % (deployedId, str(deployable.type)) for pd in deployableDescriptor.propertyDescriptors: deployedPd = deployedDescriptor.getPropertyDescriptor(pd.name) if (deployedPd): try: deployable[pdName] = deployed[pdName] except: deployable.values[pdName] = deployed[pdName] return deployable