Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

Search converts boolean values to strings #75

Open
chbrown13 opened this issue Jul 27, 2017 · 0 comments
Open

Search converts boolean values to strings #75

chbrown13 opened this issue Jul 27, 2017 · 0 comments
Labels

Comments

@chbrown13
Copy link
Contributor

chbrown13 commented Jul 27, 2017

  • satellite-populate version: 0.1.3
  • Python version: 2.7.13
  • Operating System: Fedora 25

Description

In some cases performing a search on entities fails because a boolean value True or False is converted to a string 'True' or 'False'

What I Did

test_provision_template.yaml

satellite-populate test_provision_template.yaml -h hp-bl465cgen8-01.rhts.eng.bos.redhat.com --no-output -v

...
2017-07-27 16:20:19 - satellite_populate.base - ERROR - populate: 400 Client Error: Bad Request for url: https://hp-bl465cgen8-01.rhts.eng.bos.redhat.com/api/v2/provisioning_templates {'log_message': u'test_prov_tmp', 'model': 'ProvisioningTemplate', 'register': 'test_prov_tmp', 'data': {'template_combinations': ['a', 'b', 'c'], 'snippet': True, 'locked': True, 'name': '{{ name }}', 'template': 'temp', 'audit_comment': 'comment'}}{
  "error": {"message":"'snippet' should be one of 'true, false', but the query was 'True'","class":"ScopedSearch::QueryNotSupported"}
}
...
Traceback (most recent call last):
  File "/opt/virtual_env/satellite-populate/bin/satellite-populate", line 11, in <module>
    load_entry_point('satellite-populate', 'console_scripts', 'satellite-populate')()
  File "/opt/virtual_env/satellite-populate/lib/python2.7/site-packages/click-6.7-py2.7.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/virtual_env/satellite-populate/lib/python2.7/site-packages/click-6.7-py2.7.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/virtual_env/satellite-populate/lib/python2.7/site-packages/click-6.7-py2.7.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/virtual_env/satellite-populate/lib/python2.7/site-packages/click-6.7-py2.7.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/chris/Documents/satellite-populate/satellite_populate/commands.py", line 161, in main
    hostname, username, password, report, enable_output)
  File "/home/chris/Documents/satellite-populate/satellite_populate/commands.py", line 47, in execute_populate
    enable_output=enable_output
  File "/home/chris/Documents/satellite-populate/satellite_populate/main.py", line 62, in populate
    populator.execute()
  File "/home/chris/Documents/satellite-populate/satellite_populate/base.py", line 186, in execute
    entity_data, action_data, search, action
  File "/home/chris/Documents/satellite-populate/satellite_populate/api.py", line 39, in populate
    rendered_action_data, action_data, search, model, silent_errors
  File "/home/chris/Documents/satellite-populate/satellite_populate/api.py", line 95, in action_update
    raise RuntimeError("update: Cannot find entity")
RuntimeError: update: Cannot find entity
@chbrown13 chbrown13 changed the title Boolean values converted to strings during search Search converts boolean values to strings Jul 27, 2017
@chbrown13 chbrown13 added the bug label Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant