Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Host.puppet_class field name. #346

Merged
merged 1 commit into from
Jan 16, 2017
Merged

Update Host.puppet_class field name. #346

merged 1 commit into from
Jan 16, 2017

Conversation

svtkachenko
Copy link
Contributor

@svtkachenko svtkachenko commented Dec 22, 2016

Looks like that field host[puppet_class_id] was changed to host[puppetclass_ids], so currently passing puppet_class does nothing when creating/updating host.

puppet_classes = entities.PuppetClass().search(query={
    'search': u'name ~ "generic_1" and environment = "KT_kWtydc_Library_nbVyItrg_60"'})
2016-12-23 00:31:09 - nailgun.client - DEBUG - Making HTTP GET request to https://sat6.com/api/v2/puppetclasses with options {'verify': False, 'data': '{"search": "name ~ \\"generic_1\\" and environment = \\"KT_kWtydc_Library_nbVyItrg_60\\""}', 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and no data.
2016-12-23 00:31:10 - nailgun.client - DEBUG - Received HTTP 200 response: {
   "results": {"generic_1":[{"id":24,"name":"generic_1","created_at":"2016-12-22T20:53:47.941Z","updated_at":"2016-12-22T20:53:47.941Z"}]}
}

host = entities.Host(
    environment=env.read(),
    puppetclass=puppet_classes,
).create()
2016-12-23 00:31:33 - nailgun.client - DEBUG - Making HTTP POST request to https://sat6.com/api/v2/hosts with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} 
and data .... "puppetclass_ids": [24]}}.
2016-12-23 00:31:34 - nailgun.client - DEBUG - Received HTTP 201 response: {...,
"puppetclasses":[{"id":24,"name":"generic_1","module_name":"generic_1"}],"config_groups":[],"parameters":[],"all_parameters":[],
"all_puppetclasses":[{"id":24,"name":"generic_1","module_name":"generic_1"}],...}

host.puppetclass
<type 'list'>: [nailgun.entities.PuppetClass(nailgun.config.ServerConfig(url='https://example.com', verify=False, auth=('admin', 'changeme')), id=24)]

@coveralls
Copy link

coveralls commented Dec 22, 2016

Coverage Status

Coverage decreased (-0.0007%) to 98.577% when pulling 0784225 on svtkachenko:upd_host into c7a3654 on SatelliteQE:master.

@oshtaier
Copy link
Contributor

oshtaier commented Dec 23, 2016

What's about attrs['host_parameters_attributes'] = attrs.pop('parameters')?
If that is also fixed, please make a change in one scope and remove corresponding information from docstring

If not, analyze that decrease in test coverage and do corresponding fix

@svtkachenko
Copy link
Contributor Author

svtkachenko commented Dec 23, 2016

@oshtaier Though bug mentioned in docstring is closed it was only partially fixed: only puppetclass was renamed, host_parameters_attributes still is used for POST and parameters for GET. I'm going to open another BZ.
And decrease in -0.0007% looks like measurement error or rounding error as no new lines were added :)
At least no new lines marked with red in visual coverage.

Copy link
Contributor

@abalakh abalakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. There's nothing new to cover, imo it's issue with travis algorithm as total lines quantity decreased by 1

@sghai
Copy link
Contributor

sghai commented Jan 2, 2017

@svtkachenko : field name changed for specific sat version or affects all ?

@svtkachenko
Copy link
Contributor Author

@sghai According to apidoc, 6.2 and 6.3 are affected.

@rochacbruno
Copy link
Contributor

@svtkachenko @sghai so we need to cherrypick this to 6.2.z

@svtkachenko
Copy link
Contributor Author

Shouldn't it be merged to master first? :)

Copy link
Contributor

@rochacbruno rochacbruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@svtkachenko please cherry pick this to 6.2.z branch after this merge. :)

@rochacbruno rochacbruno merged commit da70b9c into SatelliteQE:master Jan 16, 2017
oshtaier added a commit that referenced this pull request Jan 17, 2017
[6.2.z] Cherry-pick - Update Host.puppet_class field name. (#346)
elyezer added a commit to elyezer/nailgun that referenced this pull request Mar 6, 2017
Shortlog of commits since last release:

    Andrii Balakhtar (4):
          Fix read() of hostgroup without content_source, lce or cv for 6.1
          Increase timeout for manifest delete/refresh (SatelliteQE#359)
          Provide default name length & type for ComputeResource entities (SatelliteQE#369)
          Implemented Interface entity with all its fields and basic operations (SatelliteQE#373)

    Djebran Lezzoum (1):
          Merge pull request SatelliteQE#380 from svtkachenko/ct_update_payload

    Elyézer Rezende (1):
          Update travis config

    Oleksandr Shtaier (8):
          Merge pull request SatelliteQE#341 from sghai/update-test
          Merge pull request SatelliteQE#342 from renzon/332
          Merge pull request SatelliteQE#344 from elyezer/update-travis
          Merge pull request SatelliteQE#352 from svtkachenko/sv_payload
          Merge pull request SatelliteQE#345 from abalakh/fix_hg_61_workaround
          Merge pull request SatelliteQE#366 from svtkachenko/update_template_kind
          Merge pull request SatelliteQE#361 from svtkachenko/update_sv
          Merge pull request SatelliteQE#383 from svtkachenko/63_image

    Renzo Nuccitelli (3):
          Added json method to Entity (SatelliteQE#326)
          Merge pull request SatelliteQE#347 from svtkachenko/add_image
          Implemented Entity __eq__ method comparing all fields (SatelliteQE#350)

    Stanislav Tkachenko (10):
          Add content related helpers for Repository entity. (SatelliteQE#327)
          Add Create and Delete mixins to Smart Proxy (SatelliteQE#343)
          Add mixins to Image
          Override create_payload and upload_payload for SmartVariable.
          Update Host.puppet_class field name. (SatelliteQE#346)
          Removed overriden read method for Smart Variable
          Update TemplateKind entity
          Add ProvisioningTemplate. (SatelliteQE#365)
          Fix update_payload method for ConfigTemplate/ProvisioningTemplate
          [6.2.z] Update Image and Host entities (SatelliteQE#356)

    oshtaier (2):
          Add UpdateMixin for CV Filter Rules entity
          Add host count field to CV entity

    renzon (5):
          Fixed ConfigTemplate create and update with TemplateCombination
          ListFiled handled on _payload
          api fixed and methods GET and DELETED added for TemplateCombination
          api fixed and methods GET and DELETED added for TemplateCombination
          api fixed and methods GET and DELETED added for TemplateCombination

    sghai (5):
          Updated discovery_rule entity with org & location (SatelliteQE#320)
          Added a new field root_pass to hostgroup entity (SatelliteQE#336)
          Added unit test for root_pass from hostgroup entity
          Merge pull request SatelliteQE#338 from oshtaier/cvf_update_mixin
          Merge pull request SatelliteQE#340 from oshtaier/cv_field
@svtkachenko svtkachenko deleted the upd_host branch August 22, 2017 14:52
lpramuk pushed a commit to lpramuk/nailgun that referenced this pull request Sep 26, 2023
lpramuk pushed a commit to lpramuk/nailgun that referenced this pull request Sep 26, 2023
Shortlog of commits since last release:

    Andrii Balakhtar (4):
          Fix read() of hostgroup without content_source, lce or cv for 6.1
          Increase timeout for manifest delete/refresh (SatelliteQE#359)
          Provide default name length & type for ComputeResource entities (SatelliteQE#369)
          Implemented Interface entity with all its fields and basic operations (SatelliteQE#373)

    Djebran Lezzoum (1):
          Merge pull request SatelliteQE#380 from svtkachenko/ct_update_payload

    Elyézer Rezende (1):
          Update travis config

    Oleksandr Shtaier (8):
          Merge pull request SatelliteQE#341 from sghai/update-test
          Merge pull request SatelliteQE#342 from renzon/332
          Merge pull request SatelliteQE#344 from elyezer/update-travis
          Merge pull request SatelliteQE#352 from svtkachenko/sv_payload
          Merge pull request SatelliteQE#345 from abalakh/fix_hg_61_workaround
          Merge pull request SatelliteQE#366 from svtkachenko/update_template_kind
          Merge pull request SatelliteQE#361 from svtkachenko/update_sv
          Merge pull request SatelliteQE#383 from svtkachenko/63_image

    Renzo Nuccitelli (3):
          Added json method to Entity (SatelliteQE#326)
          Merge pull request SatelliteQE#347 from svtkachenko/add_image
          Implemented Entity __eq__ method comparing all fields (SatelliteQE#350)

    Stanislav Tkachenko (10):
          Add content related helpers for Repository entity. (SatelliteQE#327)
          Add Create and Delete mixins to Smart Proxy (SatelliteQE#343)
          Add mixins to Image
          Override create_payload and upload_payload for SmartVariable.
          Update Host.puppet_class field name. (SatelliteQE#346)
          Removed overriden read method for Smart Variable
          Update TemplateKind entity
          Add ProvisioningTemplate. (SatelliteQE#365)
          Fix update_payload method for ConfigTemplate/ProvisioningTemplate
          [6.2.z] Update Image and Host entities (SatelliteQE#356)

    oshtaier (2):
          Add UpdateMixin for CV Filter Rules entity
          Add host count field to CV entity

    renzon (5):
          Fixed ConfigTemplate create and update with TemplateCombination
          ListFiled handled on _payload
          api fixed and methods GET and DELETED added for TemplateCombination
          api fixed and methods GET and DELETED added for TemplateCombination
          api fixed and methods GET and DELETED added for TemplateCombination

    sghai (5):
          Updated discovery_rule entity with org & location (SatelliteQE#320)
          Added a new field root_pass to hostgroup entity (SatelliteQE#336)
          Added unit test for root_pass from hostgroup entity
          Merge pull request SatelliteQE#338 from oshtaier/cvf_update_mixin
          Merge pull request SatelliteQE#340 from oshtaier/cv_field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants