Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25622

NodeLabelParameter plugin is missing value parameter for queue jobs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • Jenkins ver. 1.554.3
      nodelabelparameter plugin ver. 1.5.1
      Host OS: Ubuntu 14.04
      To get Python api:

      This plugin will break many APIs and other plugins when there is a job in the queue.

      The queue parameter is missing the 'value' entry that is sent from Jenkins through JSON. See output after build.actions below.

      ----- Steps to reproduce
      Install Jenkins, install NodeLabelPlugin. (See environment for exact version info)
      Create a job that uses the NodeLabelPlugin.
      Build with Parameters, and fill in some some parameters (see screenshot).
      Take a look at the queue (see screenshot).
      Install Python jenkinsapi (using 0.2.16-2):
      apt-get install python-jenkinsapi
      Type in the following commands:

      >>> import jenkinsapi
      >>> jenkinsurl='http://localhost:8080'
      >>> jobname='MyJob'
      >>> jenkins = jenkinsapi.jenkins.Jenkins(jenkinsurl)
      >>> queue=jenkins.get_queue()
      >>> queued_builds = queue.get_queue_items_for_job(jobname)
      >>> build=queued_builds[0]
      >>> build.actions
      [{'parameters': [{'name': 'job_id', 'value': '0'}, {'name': 'node_label'}, {'name': 'content_id', 'value': ''}, {'name': 'config_id', 'value': ''}]}, {'causes': [{'userName': 'Matt', 'userId': 'mbells', 'shortDescription': 'Started by user Matt'}]}]
      >>> for b in queued_builds:
      ...    print (b, b.get_parameters())
      Traceback (most recent call last):
        File "<stdin>", line 2, in <module>
        File "/usr/lib/python2.7/dist-packages/jenkinsapi/queue.py", line 97, in get_parameters
          return dict([(x['name'], x['value']) for x in parameters])
      

            domi Dominik Bartholdi
            mbells Matthew Bells
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: