示例#1
0
 def get_scm_type(self):
     element_tree = self._get_config_element_tree()
     scm_class = element_tree.find('scm').get('class')
     scm = self._scm_map.get(scm_class)
     if not scm:
         raise NotSupportSCM(
             "SCM class \"%s\" not supported by API, job \"%s\"" % (scm_class, self.name))
     if scm == 'NullSCM':
         raise NotConfiguredSCM(
             "SCM does not configured, job \"%s\"" % self.name)
     return scm
示例#2
0
文件: job.py 项目: yasinai/jenkinsapi
 def get_scm_type(self):
     element_tree = self._get_config_element_tree()
     scm_class = element_tree.find('scm').get('class')
     scm = self._scm_map.get(scm_class)
     if not scm:
         raise NotSupportSCM(
             'SCM class "%s" not supported by API for job "%s"'
             % (scm_class, self.name))
     if scm == 'NullSCM':
         raise NotConfiguredSCM(
             'SCM is not configured for job "%s"' % self.name)
     return scm
示例#3
0
 def get_scm_type(self):
     element_tree = self._get_config_element_tree()
     scm_element = element_tree.find('scm')
     if not scm_element:
         multibranch_scm_prefix = \
             "properties/org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty/branch/"
         multibranch_path = multibranch_scm_prefix + "scm"
         scm_element = element_tree.find(multibranch_path)
         if scm_element:
             # multibranch pipeline.
             self._scm_prefix = multibranch_scm_prefix
     scm_class = scm_element.get('class') if scm_element else None
     scm = self._scm_map.get(scm_class)
     if not scm:
         raise NotSupportSCM(
             'SCM class "%s" not supported by API for job "%s"' %
             (scm_class, self.name))
     if scm == 'NullSCM':
         raise NotConfiguredSCM('SCM is not configured for job "%s"' %
                                self.name)
     return scm