Example #1
0
    def __init__(self,
                 threadMgr,
                 packageUri,
                 packageloc,
                 path=None,
                 category=None,
                 skipProp=True):
        #        cat = 'DC_DowloadThread' + str(datetime.now())
        AgentThread.__init__(self,
                             threadMgr,
                             cat=category,
                             name='download_thread')
        self.__path = pylons.config['repo_root']
        if path is not None:
            self.__path = path
        # check to see if the package path exists
        if (not os.path.isdir(self.__path)):
            msg = 'Package path(%s) does not exist' % self.__path
            LOG.error(msg)
            raise AgentException(Errors.PACKAGE_PATH_ERROR, msg)

        self.__uriDict = PackageUtil.parseUri(packageUri, self.__path,
                                              packageloc)
        self.__prop = {}
        self.__error = None
        self.__progress = 0.0
        self.__timeouts = None
        self.__skipProp = skipProp
Example #2
0
    def __init__(self, threadMgr, service, manifest):
        """ Constructor """
        from agent.controllers.service import ServiceController

        AgentThread.__init__(self, threadMgr, cat = [ServiceController.serviceCat(service)], name = 'delete_manifest')
        self.service = service
        self.manifest = manifest
 def __init__(self, threadMgr, service, manifest, name = 'agent_thread', parentId = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [manifestutil.serviceCat(service)], name = name, parentId = parentId)
     self.__manifest = manifest
     self.__service = service
     contextutils.injectcontext(self, {'service':service})
     self._LOG = manifestutil.getServiceLogger(self, logging.getLogger(__name__))
Example #4
0
 def __init__(self, threadMgr, uuid):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[uuid],
                          name='cancel_agentthread')
     self.__uuid = uuid
Example #5
0
 def __init__(self, threadMgr, wisbVersion, wisbSource = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [AgentUpdate.CAT], name = AgentUpdate.THREAD_NAME)
     self.__wisbVersion = wisbVersion
     self.__wisbSource = wisbSource
     self.__packages = []
     self.__service = 'agent'
     self.__manifest = ('agent_selfupdate-%s' % self.__wisbVersion)
Example #6
0
 def __init__(self, threadMgr, service, path):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[manifestutil.serviceCat(service)],
                          name='delete_service')
     self.__path = path
     self.service = service
Example #7
0
 def __init__(self, threadMgr, module):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[manifestutil.serviceCat('agent')],
                          name='delete_module')
     self.__module = module
     self.__service = 'agent'
Example #8
0
 def __init__(self, threadMgr, stopOnly=False):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[ServicesCleanup.CAT],
                          name='cleanup_service')
     self.__killTimeout = configutil.getConfigAsInt(
         'agent_thread_timeout')  #kill -9 should take no time
     self.__stopOnly = stopOnly
 def __init__(self, threadMgr, service, manifest, name = 'agent_thread'):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [manifestutil.serviceCat(service)], name = name)
     self.__manifest = manifest
     self.__service = service
     injectcontext(self, {'service':service})
     # maintain a stack that has all the recovery script paths
     # this stack is protected
     self._stack = []
Example #10
0
    def __init__(self, threadMgr, service, manifest):
        """ Constructor """
        from agent.controllers.service import ServiceController

        AgentThread.__init__(self,
                             threadMgr,
                             cat=[ServiceController.serviceCat(service)],
                             name='delete_manifest')
        self.service = service
        self.manifest = manifest
Example #11
0
 def __init__(self, threadMgr, wisbVersion, wisbSource=None, skipProp=True):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[AgentUpdate.CAT],
                          name=AgentUpdate.THREAD_NAME)
     self.__wisbVersion = wisbVersion
     self.__wisbSource = wisbSource
     self.__packages = []
     self.__service = 'agent'
     self.__manifest = ('agent_selfupdate-%s' % self.__wisbVersion)
     self.__skipProp = skipProp
Example #12
0
 def __init__(self, threadMgr, service, manifest, name='agent_thread'):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[manifestutil.serviceCat(service)],
                          name=name)
     self.__manifest = manifest
     self.__service = service
     injectcontext(self, {'service': service})
     # maintain a stack that has all the recovery script paths
     # this stack is protected
     self._stack = []
Example #13
0
    def __init__(self, threadMgr, packageUri, packageloc, path = None, category = None, skipProp = True):
#        cat = 'DC_DowloadThread' + str(datetime.now())
        AgentThread.__init__(self, threadMgr, cat = category, name = 'download_thread')
        self.__path = pylons.config['repo_root']
        if path is not None:
            self.__path = path
        # check to see if the package path exists
        if (not os.path.isdir(self.__path)):
            msg = 'Package path(%s) does not exist' % self.__path
            LOG.error(msg)
            raise AgentException(Errors.PACKAGE_PATH_ERROR, msg)
        
        self.__uriDict = PackageUtil.parseUri(packageUri, self.__path, packageloc)
        self.__prop = {}
        self.__error = None
        self.__progress = 0.0
        self.__timeouts = None
        self.__skipProp = skipProp
Example #14
0
 def __init__(self, threadMgr, packageUri, packageloc, path = None, category = None, parentId = None):
     AgentThread.__init__(self, threadMgr, cat = category, name = 'download_thread', parentId = parentId)
     
     self._mergeOnFound = True
     self.__path = pylons.config['repo_root']
     if path is not None:
         self.__path = path
     # check to see if the package path exists
     if (not os.path.isdir(self.__path)):
         msg = 'Package path(%s) does not exist' % self.__path
         LOG.error(msg)
         raise AgentException(Errors.PACKAGE_PATH_ERROR, msg)
     
     self.__uriDict = PackageUtil.parseUri(packageUri, self.__path, packageloc)
     self.__prop = {}
     self.__error = None
     self.__progress = 0.0
     self.__timeouts = None
     self.__skipProp = configutil.getConfigAsBool('download_skip_prop')
Example #15
0
    def __init__(self, threadMgr, cmd, cat = None, parentId = None):
        """ Constructor.
        @param threadMgr - the thread Mgr object
        @param cmd - cmd list
        @param timeout - amount of time we give to this thread
        """
        AgentThread.__init__(self, threadMgr, cat, name = 'exec_thread', parentId = parentId)

        self.__cmd = cmd
        
        # default timeouts configuration
        self._timeout = int(config['exec_thread_timeout'])
        self._progressTimeout = int(config['exec_thread_progress_timeout'])
        self.__service = None
        self.__cmdProcess = None
        self.__response = {}
        self.__partial_response = None
        self.__partial = ''
        self.__outputlines = []
        self.__injectctx = True
        self.__logLevel = 'info'
        self.__LOG = None
Example #16
0
    def __init__(self, threadMgr, cmd, cat = None):
        """ Constructor.
        @param threadMgr - the thread Mgr object
        @param cmd - cmd list
        @param timeout - amount of time we give to this thread
        """
        if threadMgr is None:
            threadMgr = NullThreadMgr()

        AgentThread.__init__(self, threadMgr, cat, name = 'exec_thread')

        self.__cmd = cmd
        
        # default timeouts configuration
        self._timeout = int(config['exec_thread_timeout'])
        self._progressTimeout = int(config['exec_thread_progress_timeout'])
        
        self.__cmdProcess = None
        self.__response = {}
        self.__partial_response = None
        self.__partial = ''
        self.__logLevel = 'info'
        service = 'agent'
        self.__LOG = manifestutil.getServiceLogger(self, logging.getLogger(__name__), service)
Example #17
0
 def __init__(self, threadMgr):
     """ Constructor """
     AgentThread.__init__(self,
                          threadMgr,
                          cat=[SafeShutdown.CAT],
                          name=SafeShutdown.THREAD_NAME)
Example #18
0
 def __init__(self, threadMgr, cat=['service/test']):
     AgentThread.__init__(self, threadMgr, cat=cat)
Example #19
0
 def __init__(self, threadMgr, cat = None, name = 'agent_thread'):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = cat, name = name)
Example #20
0
 def __init__(self, threadMgr, cat=None):
     AgentThread.__init__(self, threadMgr, cat)
Example #21
0
 def __init__(self, threadMgr, progress_queue):
     AgentThread.__init__(self, threadMgr, cat=['Service/test_status'])
     self.progress_queue = progress_queue
Example #22
0
 def __init__(self, threadMgr, cat = None, name = 'agent_thread', parentId = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = cat, name = name, parentId = parentId)
 def __init__(self, threadMgr, uuid):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [uuid], name = 'cancel_agentthread')
     self.__uuid = uuid
Example #24
0
 def __init__(self, threadMgr):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [SafeShutdown.CAT], name = SafeShutdown.THREAD_NAME)
 def __init__(self, threadMgr, package, parentId = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, name = 'validate_package', parentId = parentId)
     self.__package = package
Example #26
0
 def __init__(self, threadMgr, cat = ['service/test']):
     AgentThread.__init__(self, threadMgr, cat = cat)
 def __init__(self, threadMgr, stopOnly=False):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [ServicesCleanup.CAT], name = 'cleanup_service')
     self.__killTimeout = configutil.getConfigAsInt('agent_thread_timeout') #kill -9 should take no time
     self.__stopOnly = stopOnly
Example #28
0
 def __init__(self, threadMgr, cat = None):
     AgentThread.__init__(self, threadMgr, cat)
Example #29
0
 def __init__(self, threadMgr, service, path):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [manifestutil.serviceCat(service)], name = 'delete_service')
     self.__path = path
     self.service = service
Example #30
0
 def __init__(self, threadMgr, module, parentId = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [manifestutil.serviceCat('agent')], name = 'delete_module', parentId = parentId)
     self.__module = module
     self.__service = 'agent'
Example #31
0
 def __init__(self, threadMgr, package):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, name='validate_package')
     self.__package = package
Example #32
0
 def __init__(self, threadMgr, service, manifest, parentId = None):
     """ Constructor """
     AgentThread.__init__(self, threadMgr, cat = [manifestutil.serviceCat(service)], name = 'delete_manifest', parentId = parentId)
     self.service = service
     self.manifest = manifest