pycontribs / jenkinsapi

A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
http://pypi.python.org/pypi/jenkinsapi
MIT License
859 stars 485 forks source link

Create Node by providing predetermined configuration #730

Closed kennedy closed 5 years ago

kennedy commented 5 years ago

The current workflow in creating a new node allows the user to provide a small and limited array of configurations

jenkins.create_node(name, num_executors=2, node_description=None,
                    remote_fs='/var/lib/jenkins',
                    labels=None, exclusive=False)
...
node_dict = {
            'num_executors': num_executors,
            'node_description': node_description,
            'remote_fs': remote_fs,
            'labels': labels,
            'exclusive': exclusive
        }

However, in order to configure the node to exactly how I would like it, I would have to create it, then send a modify step.

This pull request allows an advanced user the ability to create the node exactly, right from the start. This is important because I have my configurations in source control so every new agent is created the same.

kennedy commented 5 years ago

My changes does not work with python 2.7. I shall make it compatible

lechat commented 5 years ago

Please check Travis build results.

kennedy commented 5 years ago

Please check Travis build results.

yike! I used type() instead of isinstance()

kennedy commented 5 years ago

It seems the error was something to do with credentials.py unrelated to what I submitted for review unfortunately.

I shall make an issue out of it, and I will take a stab at it.

On Sun, Oct 13, 2019, at 7:17 PM, Aleksey Maksimov wrote:

Please check Travis build results.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pycontribs/jenkinsapi/pull/730?email_source=notifications&email_token=AAGQUDYYJP4JYGU23LVTD23QOOT7JA5CNFSM4JAFEW52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBDCVHI#issuecomment-541469341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQUD3SYWMHMFUB6UQ3LQLQOOT7JANCNFSM4JAFEW5Q.

codecov[bot] commented 5 years ago

Codecov Report

Merging #730 into master will decrease coverage by 0.34%. The diff coverage is 16.66%.

@@            Coverage Diff            @@
##           master    #730      +/-   ##
=========================================
- Coverage   79.25%   78.9%   -0.35%     
=========================================
  Files          34      34              
  Lines        2776    2788      +12     
=========================================
  Hits         2200    2200              
- Misses        576     588      +12