Exemple #1
0
 def __init__(self, db):
     '''
        General description :
        This function initializes the database variables and \
        index to refer in functions.
     '''
     self.db = db
     self.configdb = Config.Config(db)
     self.toolDB = Tool.Tool(self.db)
     self.userDB = Users.Users(self.db)
     self.roleDB = Role.Role(self.db)
     self.buildsDB = Build.Build()
     self.versionsDB = Versions.Versions(db)
     self.emailsDB = Emails.Emails(self.db)
     self.deploymentRequestDB = DeploymentRequest.DeploymentRequest(db)
     self.CloneRequestDB = CloneRequest.CloneRequest(db)
     self.contributionGitPushLogs = ContributionGitPushLogs.ContributionGitPushLogs(
         db)
     self.sync = Sync.Sync(db)
     self.auditingDB = Auditing.Auditing()
     self.distributionSync = DistributionSync.DistributionSync(db)
     self.mediaFilesDB = MediaFiles.MediaFiles(self.db)
     self.logo_path = logo_path
     self.full_logo_path = str(current_path) + self.logo_path
     self.media_files_path = media_path
     self.full_media_files_path = media_full_path
     self.folder_list_to_clean = [
         export_full_path, distribution_center_export_full_path
     ]
     self.config_id = 15
     self.load_configuration()
     self.schedulerService = SchedulerService.SchedulerService()
     self.deploymentUnitDB = DeploymentUnit.DeploymentUnit()
     self.repositoryDB = Repository.Repository()
Exemple #2
0
    def __init__(self, db):
        # Need to add code for Clone

        self.CloneRequestDB = CloneRequest.CloneRequest(db)
        self.noOfThreads = 1  # Minimum Threads is 1
        self.configdb = Config.Config(db)
        self.config_id = 4
        self.load_configuration()
        self.schedulerService = SchedulerService.SchedulerService()
# blueprint declaration
distributionCenterAPI = Blueprint('distributionCenterAPI', __name__)
# restplus declaration
distributionCenterAPINs = api.namespace(
    'clonerequest/distribution', description='Distribution Center Operations')

# get global db connection
db = mongodb

# collection
configdb = Config.Config(db)
distributionCenterConfig = configdb.getConfigByName("PushServices")

# collections
cloneRequestDB = CloneRequest.CloneRequest(db)
machineDB = Machine.Machine(db)
distributionMachinetDB = DistributionMachine.DistributionMachine(db)
if distributionCenterConfig:
    distributionCenterService = DistributionCenterService.DistributionCenterService(
        db)
distributionsyncDB = DistributionSync.DistributionSync(db)
tooldb = Tool.Tool(db)
versionsDB = Versions.Versions(db)
accountDB = Accounts.Accounts()
distributionMachinetDB = DistributionMachine.DistributionMachine(db)
# classes


@distributionCenterAPI.route('/clonerequest/distribution/all', methods=['GET'])
@authService.authorized
from DBUtil import Teams,Machine,DeploymentRequest,DeploymentUnitSet,DeploymentUnit,MachineGroups,\
DistributionMachine,DeploymentRequestGroup,CloneRequest,ToolsOnMachine,UserFavoriteMachine,MachineType,\
Accounts,Tags,Users, Tool, Versions, Build
from settings import mongodb
from Services import HelperServices, TeamService, FlexibleAttributesHelper, EnvironmentVariablesHelper, Utils, AccountHelperService

teamsdb = Teams.Teams(mongodb)
machinedb = Machine.Machine(mongodb)
deploymentrequestdb = DeploymentRequest.DeploymentRequest(mongodb)
deploymentrequestgroupdb = DeploymentRequestGroup.DeploymentRequestGroup(
    mongodb)
deploymentunitsetdb = DeploymentUnitSet.DeploymentUnitSet()
deploymentunitdb = DeploymentUnit.DeploymentUnit()
machinegroupdb = MachineGroups.MachineGroups(mongodb)
distributionmachinetdb = DistributionMachine.DistributionMachine(mongodb)
clonerequestdb = CloneRequest.CloneRequest(mongodb)
toolsonmachinedb = ToolsOnMachine.ToolsOnMachine(mongodb)
machineFavDb = UserFavoriteMachine.UserFavoriteMachine(mongodb)
machineTypeDb = MachineType.MachineType(mongodb)
accountDB = Accounts.Accounts()
machineDB = Machine.Machine(mongodb)
tagDB = Tags.Tags()
teamsDb = Teams.Teams(mongodb)
teamService = TeamService.TeamService()
machinegroupDB = MachineGroups.MachineGroups(mongodb)
userdb = Users.Users(mongodb)
distributionMachinetDB = DistributionMachine.DistributionMachine(mongodb)
tooldb = Tool.Tool(mongodb)
versionsDB = Versions.Versions(mongodb)
buildDB = Build.Build()