Exemple #1
0
Fichier : tests.py Projet : ymc/hue
    def create_job(self,
                   _type="IMPORT",
                   name="test1",
                   connection_id=1,
                   connector_id=1):
        job = Job(_type, name, connection_id, connector_id)
        job.framework = self.client.get_framework().job_forms[_type]
        job.connector = self.client.get_connectors()[0].job_forms[_type]

        for _connector in job.connector:
            for _input in _connector.inputs:
                if _input.name not in JOB_FORM_VALUES:
                    LOG.warning(
                        "Job input mapping %s does not exist. Maybe it's new?"
                        % _input.name)
                elif JOB_FORM_VALUES[_input.name]:
                    _input.value = JOB_FORM_VALUES[_input.name]

        for _framework in job.framework:
            for _input in _framework.inputs:
                if _input.name not in FRAMEWORK_FORM_VALUES:
                    LOG.warning(
                        "Framework input mapping %s does not exist. Maybe it's new?"
                        % _input.name)
                elif FRAMEWORK_FORM_VALUES[_input.name]:
                    _input.value = FRAMEWORK_FORM_VALUES[_input.name]

        return self.client.create_job(job)
Exemple #2
0
  def create_job(self, _type="IMPORT", name="test1", connection_id=1, connector_id=1):
    job = Job(_type, name, connection_id, connector_id)
    job.framework = self.client.get_framework().job_forms[_type]
    job.connector = self.client.get_connectors()[0].job_forms[_type]

    for _connector in job.connector:
      for _input in _connector.inputs:
        if JOB_FORM_VALUES[_input.name]:
          _input.value = JOB_FORM_VALUES[_input.name]

    for _framework in job.framework:
      for _input in _framework.inputs:
        if FRAMEWORK_FORM_VALUES[_input.name]:
          _input.value = FRAMEWORK_FORM_VALUES[_input.name]

    return self.client.create_job(job)
Exemple #3
0
  def create_job(self, _type="IMPORT", name="test1", connection_id=1, connector_id=1):
    job = Job(_type, name, connection_id, connector_id)
    job.framework = self.client.get_framework().job_forms[_type]
    job.connector = self.client.get_connectors()[0].job_forms[_type]

    for _connector in job.connector:
      for _input in _connector.inputs:
        if _input.name not in JOB_FORM_VALUES:
          LOG.warning("Job input mapping %s does not exist. Maybe it's new?" % _input.name)
        elif JOB_FORM_VALUES[_input.name]:
          _input.value = JOB_FORM_VALUES[_input.name]

    for _framework in job.framework:
      for _input in _framework.inputs:
        if _input.name not in FRAMEWORK_FORM_VALUES:
          LOG.warning("Framework input mapping %s does not exist. Maybe it's new?" % _input.name)
        elif FRAMEWORK_FORM_VALUES[_input.name]:
          _input.value = FRAMEWORK_FORM_VALUES[_input.name]

    return self.client.create_job(job)
Exemple #4
0
    def create_job(self,
                   _type="IMPORT",
                   name="test1",
                   connection_id=1,
                   connector_id=1):
        job = Job(_type, name, connection_id, connector_id)
        job.framework = self.client.get_framework().job_forms[_type]
        job.connector = self.client.get_connectors()[0].job_forms[_type]

        for _connector in job.connector:
            for _input in _connector.inputs:
                if JOB_FORM_VALUES[_input.name]:
                    _input.value = JOB_FORM_VALUES[_input.name]

        for _framework in job.framework:
            for _input in _framework.inputs:
                if FRAMEWORK_FORM_VALUES[_input.name]:
                    _input.value = FRAMEWORK_FORM_VALUES[_input.name]

        return self.client.create_job(job)