Пример #1
0
 def __init__(self, config, logger, sitename):
     self.sitename = sitename
     self.logger = logger
     self.config = config
     self.siteDB = contentDB(logger=self.logger, config=self.config)
     self.dbI = getDBConn('PolicyService')
     self.stateMachine = StateMachine(self.logger)
Пример #2
0
#!/usr/bin/env python
""" List all deltas inFrontend """
import sys
from DTNRMLibs.MainUtilities import getVal
from DTNRMLibs.MainUtilities import evaldict
from DTNRMLibs.MainUtilities import getConfig, getStreamLogger
from DTNRMLibs.FECalls import getDBConn
from SiteFE.PolicyService.stateMachine import StateMachine


LOGGER = getStreamLogger()
CONFIG = getConfig()
STATEMACHINE = StateMachine(LOGGER)


def getdeltaAll(sitename):
    dbI = getDBConn('listalldeltas')
    dbobj = getVal(dbI, sitename=sitename)
    for delta in dbobj.get('deltas'):
        delta['addition'] = evaldict(delta['addition'])
        delta['reduction'] = evaldict(delta['reduction'])
        print '='*80
        print 'Delta UID  :  ', delta['uid']
        print 'Delta RedID:  ', delta['reductionid']
        print 'Delta State:  ', delta['state']
        print 'Delta ModAdd: ', delta['modadd']
        print 'Delta InsDate:', delta['insertdate']
        print 'Delta Update: ', delta['updatedate']
        print 'Delta Model:  ', delta['modelid']
        print 'Delta connID: ', delta['connectionid']
        print 'Delta Deltatype: ', delta['deltat']
Пример #3
0
 def __init__(self, config, logger):
     self.logger = logger
     self.config = config
     self.siteDB = contentDB(logger=self.logger, config=self.config)
     self.dbI = getDBConn()
     self.stateMachine = StateMachine(self.logger)