Beispiel #1
0
def ListCheckedOutObjects(**KeyWordArguments):
    thisproc = "ListCheckedOutObjects"
    """ List Components that are currently checked out """

    KeyWordArguments["Tool"] = "ListCheckOutObjects"
    ListCheckedOutCommand = buildCommand.build(**KeyWordArguments)
    output, error = executeInfacmd.execute(ListCheckedOutCommand)

    # The output is in the form of one object per line, with properties spearated by a comma + space.
    # To filter out irrelevant lines, such as "Command succesful", we keep only line that start with "MRS_PATH="
    OutputLines = output.splitlines()
    OutputKeyValuePairLines = [
        Properties.split(", ") for Properties in OutputLines
        if Properties.startswith("MRS_PATH=")
    ]

    # ObjectsOLD = [[KVPair.split("=", 1) for KVPair in Line] for Line in OutputKeyValuePairLines]

    # Each object is a dictionary, with properties as keys
    # Since the date field has a comma in it, its not parsed properly. For this reason we need the len == 2 filter
    # If the date is required, the parsing of the output should be adjusted
    Objects = [
        dict(
            KVPair.split("=") for KVPair in Line
            if len(KVPair.split("=")) == 2) for Line in OutputKeyValuePairLines
    ]

    supporting.log(logging.DEBUG, thisproc, output)

    return (Objects)
Beispiel #2
0
def CheckInMutiple(**KeyWordArguments):
    thisproc = "CheckInMultiple"
    """ Check in Multiple IDQ components """
    for key, value in KeyWordArguments.items():
        if key == "MultipleObjectPaths":
            ObjectPaths = KeyWordArguments["MultipleObjectPaths"]

    KeyWordArguments["Tool"] = "CheckIn"

    CheckInCommands = []
    for ObjectPathName in ObjectPaths:
        KeyWordArguments["ObjectPathName"] = ObjectPathName
        CheckInCommands.append(buildCommand.build(**KeyWordArguments))

    CheckInAllCommand = "\n".join(CheckInCommands)

    timebefore = datetime.datetime.now()
    output, error = executeInfacmd.execute(CheckInAllCommand)
    timeafter = datetime.datetime.now()
    duration = timeafter - timebefore

    supporting.log(
        logging.DEBUG, thisproc, "Infacmd took " + str(duration) +
        " seconds to check-in " + str(len(ObjectPaths)) + " objects")

    # output, error = (CheckInAllCommand, 0)

    return (output, error)
Beispiel #3
0
def CheckIn(**KeyWordArguments):
    """Check-in IDQ Components"""

    KeyWordArguments["Tool"] = "CheckIn"
    CheckInCommand = buildCommand.build(**KeyWordArguments)
    output, error = executeInfacmd.execute(CheckInCommand)

    return (output, error)
Beispiel #4
0
def import_infadeveloper(**KeyWordArguments):
    """Import IDQ Components"""

    KeyWordArguments["Tool"] = "Import"
    ImportCommand = buildCommand.build(**KeyWordArguments)

    output, error = executeInfacmd.execute(ImportCommand)

    return (output, error)
Beispiel #5
0
def CreateFolder(**KeyWordArguments):
    """Create IDQ Folder"""

    KeyWordArguments["Tool"] = "CreateFolder"

    CreateFolder = buildCommand.build(**KeyWordArguments)

    output, error = executeInfacmd.execute(CreateFolder)

    return (output, error)
Beispiel #6
0
def export_infadeveloper(**KeyWordArguments):
    thisproc = "export_infadeveloper"

    KeyWordArguments["Tool"] = "Export"
    ExportCommand = buildCommand.build(**KeyWordArguments)

    supporting.log(logger, logging.INFO, thisproc,
                   "ExportCommand is >" + ExportCommand + "<.")
    result = executeInfacmd.execute(ExportCommand)

    return (result)
Beispiel #7
0
    def manage(self):
        RunCommand = buildCommand.build(**self.keyword_arguments)

        log(self.logger, logging.INFO, __name__, "RunCommand is >" + RunCommand + "<.")
        result = executeInfacmd.execute(RunCommand)

        if(result.rc != errorcodes.OK.rc):
            oldResult = result.message
            result = self.keyword_arguments["OnError"]
            result.message = oldResult

        return (result)
Beispiel #8
0
    def manage(self):
        """Runs Informatica command line to create, delete, update security related objects,
        like users and groups.
        """
        run_command = buildCommand.build(**self.keyword_arguments)

        masked_run_command = mask_password(run_command)

        log(self.logger, logging.DEBUG, __name__,
            "RunCommand is >" + masked_run_command + "<.")
        result = executeInfacmd.execute(run_command)

        if (result.rc != errorcodes.OK.rc):
            oldResult = result.message
            result = self.keyword_arguments["OnError"]
            result.message = oldResult

        return (result)