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

manageiq_config.py - add ability to modify ManageIQ config #35182

Open
wants to merge 3 commits into
base: devel
from

Conversation

@itewk

itewk commented Jan 22, 2018

SUMMARY

Adds the ability to modify ManageIQ config. The ability to manage the config of a ManageIQ appliance is not exposed via the REST API therefor this module uses the rails runner to run the MiqServer.my_server.get_config and MiqServer.my_server.set_config functions to acomplish it's task.

This module is very important to being able to fully automate the deployment and configuration management of ManageIQ appliances because otherwise a user has to manually log into the UI of each and every appliance and go to the advanced settings tab to modify settings like memory thresholds and SMTP configuration.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

manageiq_config

ANSIBLE VERSION
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ian/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May  3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

ADDITIONAL INFORMATION
# set the smtp settings
- manageiq_config:
    name: smtp
    value:
      from: cfme@example.com
      host: postfix.example.com
      port: 25
      domain: example.com

# set generic worker memory threshold
- manageiq_config:
    name: workers
    value:
      worker_base:
        queue_worker_base:
          generic_worker:
            memory_threshold: '900.megabytes'
@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

The test ansible-test sanity --test boilerplate [?] failed with the following error:

Command "test/sanity/code-smell/boilerplate.sh" returned exit status 2.
>>> Standard Output
== Missing __metaclass__ = type ==
./lib/ansible/modules/remote_management/manageiq/manageiq_config.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/remote_management/manageiq/manageiq_config.py

The test ansible-test sanity --test no-dict-iteritems [?] failed with the following error:

Command "test/sanity/code-smell/no-dict-iteritems.sh" returned exit status 1.
>>> Standard Output
iteritems has been removed in python3.  Alternatives:
    for KEY, VALUE in DICT.items():
    from ansible.module_utils.six import iteritems ; for KEY, VALUE in iteritems(DICT):
./lib/ansible/modules/remote_management/manageiq/manageiq_config.py:    for k, v in merge_dct.iteritems():

The test ansible-test sanity --test no-wildcard-import [?] failed with the following error:

Command "test/sanity/code-smell/no-wildcard-import.sh" returned exit status 2.
>>> Standard Output
== Wildcard imports detected ==
./lib/ansible/modules/remote_management/manageiq/manageiq_config.py:from ansible.module_utils.basic import *

The test ansible-test sanity --test pep8 [?] failed with the following errors:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:72:25: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:76:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:92:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:98:49: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:98:159: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:98:161: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:98:161: E501 line too long (172 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:98:171: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:100:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:100:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:104:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:10: E126 continuation line over-indented for hanging indent
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:27: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:36: E241 multiple spaces after ','
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:46: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:48: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:27: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:46: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:48: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:113:22: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:113:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:113:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:114:28: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:114:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:119:16: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:119:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:119:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:120:13: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:120:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:120:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:121:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:121:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:122:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:122:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:122:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:123:13: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:123:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:123:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:19: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:155:62: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:155:161: E501 line too long (228 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:155:215: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:155:217: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:155:227: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:157:33: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:157:35: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:162:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:174:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:174:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:174:161: E501 line too long (176 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:180:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:180:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:180:161: E501 line too long (205 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:182:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:183:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:185:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test pylint [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:100:110: undefined-variable Undefined variable 'result'

The test ansible-test sanity --test validate-modules [?] failed with the following errors:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E105 GPLv3 license header not found in the first 20 lines of the module
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E307 version_added should be 2.5. Currently 2.4
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E319 RETURN.name.returned: required key not provided @ data['returned']. Got None
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E319 RETURN.original_value.returned: required key not provided @ data['returned']. Got None
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E319 RETURN.value.returned: required key not provided @ data['returned']. Got None
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E322 "value" is listed in the argument_spec, but not documented in the module
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E323 "new" is listed in DOCUMENTATION.options, but not accepted by the module
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:66:0: E208 module_utils imports should import specific components, not "*"

click here for bot help

@itewk itewk force-pushed the itewk:manageiq_config branch Jan 22, 2018

@yaacov

This comment has been minimized.

Contributor

yaacov commented Jan 22, 2018

@ansibot ansibot removed the needs_triage label Jan 22, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

The test ansible-test sanity --test pep8 [?] failed with the following errors:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:80:25: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:84:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:100:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:106:49: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:106:159: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:106:161: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:106:161: E501 line too long (172 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:106:171: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:112:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:10: E126 continuation line over-indented for hanging indent
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:27: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:36: E241 multiple spaces after ','
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:46: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:115:48: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:27: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:46: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:116:48: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:121:22: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:121:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:121:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:122:28: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:122:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:127:16: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:127:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:127:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:128:13: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:128:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:128:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:129:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:129:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:13: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:138:19: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:163:62: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:163:161: E501 line too long (228 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:163:215: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:163:217: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:163:227: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:33: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:35: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:170:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:182:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:182:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:182:161: E501 line too long (176 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:188:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:188:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:188:161: E501 line too long (205 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:190:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:191:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:193:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test pylint [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:110: undefined-variable Undefined variable 'result'

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E323 "manageiq_connection" is listed in DOCUMENTATION.options, but not accepted by the module

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Jan 22, 2018

@elad661

This comment has been minimized.

Contributor

elad661 commented Jan 22, 2018

Let me know when you finish addressing the bot's feedback so I can start doing a proper review.

I think this kind of module is important, but the implementation has a major downside - it doesn't seem possible to use this on "podified ManageIQ" (ie. ManageIQ running in a container under OpenShift).

It would've been much better if API could be added for this functionality.

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

The test ansible-test sanity --test pylint [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:109:108: undefined-variable Undefined variable 'result'

The test ansible-test sanity --test pep8 [?] failed with the following errors:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:101:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:161: E501 line too long (169 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:107:168: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:117:10: E126 continuation line over-indented for hanging indent
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:117:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:117:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:117:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:117:34: E241 multiple spaces after ','
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:123:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:123:24: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:124:28: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:124:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:129:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:129:18: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:132:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:132:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:133:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:133:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:62: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:161: E501 line too long (228 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:215: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:217: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:165:227: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:167:33: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:167:35: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:172:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:184:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:184:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:184:161: E501 line too long (176 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:190:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:190:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:190:161: E501 line too long (205 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:192:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:193:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:195:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E323 "manageiq_connection" is listed in DOCUMENTATION.options, but not accepted by the module

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Jan 22, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

The test ansible-test sanity --test import --python 2.6 [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:75:0: ImportError: No module named errors

The test ansible-test sanity --test import --python 2.7 [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:75:0: ImportError: No module named errors

The test ansible-test sanity --test import --python 3.5 [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:75:0: ImportError: No module named 'ansible.errors'

The test ansible-test sanity --test import --python 3.6 [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:75:0: ModuleNotFoundError: No module named 'ansible.errors'

The test ansible-test sanity --test import --python 3.7 [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:75:0: ModuleNotFoundError: No module named 'ansible.errors'

The test ansible-test sanity --test pep8 [?] failed with the following errors:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:102:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:161: E501 line too long (169 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:108:168: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:10: E126 continuation line over-indented for hanging indent
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:14: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:118:34: E241 multiple spaces after ','
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:119:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:119:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:124:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:124:24: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:125:28: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:125:30: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:130:18: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:131:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:132:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:132:25: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:133:14: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:133:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:134:13: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:134:15: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:169:62: E221 multiple spaces before operator
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:169:161: E501 line too long (228 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:169:215: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:169:217: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:169:227: E202 whitespace before ')'
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:171:33: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:171:35: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:179:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:194:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:194:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:194:161: E501 line too long (176 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:200:29: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:200:31: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:200:161: E501 line too long (205 > 160 characters)
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:202:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:203:7: E111 indentation is not a multiple of four
lib/ansible/modules/remote_management/manageiq/manageiq_config.py:205:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E323 "manageiq_connection" is listed in DOCUMENTATION.options, but not accepted by the module

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Jan 22, 2018

lib/ansible/modules/remote_management/manageiq/manageiq_config.py Outdated
# verifty that the updated value equals the expected value
# if the updated value does not match the expected value then error
# else update or noop succesful
if update_value != updated_value:

This comment has been minimized.

@yaacov

yaacov Jan 22, 2018

Contributor

have you ever reached this update_value != updated_value ?

the while in L192 will run until retries >= CONFIRM_UPDATE_MAX_RETRY is true or fail
so if update_value != updated_value it must be also retries >= CONFIRM_UPDATE_MAX_RETRY and
then you will fail in L202 ?

am I missing something ?

This comment has been minimized.

@itewk

itewk Jan 22, 2018

@yaacov you are not missing something. I missed it. Originally i didn't have the retry loop in there and then after I added it in I didn't notice the logic redundancy you pointed out. Thank you. Latest commit removes the redundant if/else

@itewk itewk force-pushed the itewk:manageiq_config branch Jan 22, 2018

@itewk

This comment has been minimized.

itewk commented Jan 22, 2018

I think I finally fixed all the bot errors, squashed down all my little commits...here is hoping...

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jan 22, 2018

@abellotti @cben @dkorn @elad661 @gtanzillo @yaacov @zgalor

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot removed the needs_revision label Jan 22, 2018

@itewk itewk force-pushed the itewk:manageiq_config branch to 9781a6d Feb 11, 2018

@itewk

This comment has been minimized.

itewk commented Feb 11, 2018

@cben and @yaacov merged in the recommendations. Thanks again for all the reviews, comments, suggestions, etc.

@yaacov

This comment has been minimized.

Contributor

yaacov commented Feb 11, 2018

shipit
:-)

@itewk

This comment has been minimized.

itewk commented Feb 13, 2018

@cben how do the changes look to you?

@cben

This comment has been minimized.

Contributor

cben commented Feb 13, 2018

See my comment #35182 (comment) about reloading config, I'm afraid I mislead you.
Anyway LGTM.
shipit

@ansibot ansibot added shipit and removed community_review labels Feb 13, 2018

@itewk

This comment has been minimized.

itewk commented Feb 13, 2018

@cben i went through a whole new test cycle after updating to use Vmdb::Settings.save!(MiqServer.my_server, ...) that call did not have the async issue I had with MiqServer.my_server.set_config that required adding in the MiqServer.my_server.save! to do the blocking. So unless you are speaking of something else, I don't think we have any issues.

@itewk

This comment has been minimized.

itewk commented Feb 14, 2018

@cben and @yaacov now that we have the nifty shipit tag does the ansibot take over from there?

@elad661

This comment has been minimized.

Contributor

elad661 commented Feb 15, 2018

@itewk unfortunately not. Since this is a new module pull request, it needs to be reviewed by a core ansible maintainer (in addition to module maintainers like us) before it can be merged.

@yaacov

This comment has been minimized.

Contributor

yaacov commented Feb 15, 2018

@cben and @yaacov now that we have the nifty shipit tag does the ansibot take over from there?

@resmo ?

@itewk

This comment has been minimized.

itewk commented Feb 20, 2018

@resmo @elad661 @cben @yaacov I am not above shipping someone cookies if I am told who the right someone is :)

argument_spec=dict(
name=dict(type='str', required=True),
value=dict(type='dict', required=False, default={}),
vmdb_path=dict(type='str', required=False, default='/var/www/miq/vmdb'),

This comment has been minimized.

@resmo
# to update other defaults on the first update of the configuration after
# and upgrade. Therefor, recreating the expected value from the updated current
# value protects against that.
current_value = get_manageiq_config_value(module, module.params['name'])

This comment has been minimized.

@resmo

resmo Feb 20, 2018

Member

I noticed, there is a raise exception in this function, but not try/except here, (there is one on Line 151). also add try catch here?

@Fryguy

This comment has been minimized.

Member

Fryguy commented Feb 23, 2018

Sorry all...I didn't see the ping until now. We do have an API for settings, so I'm a little confused. ManageIQ/manageiq-api#275 was merged on Jan 15, and it was released as part of Gaprindashvili-1.

@itewk

This comment has been minimized.

itewk commented Feb 23, 2018

@Fryguy well feb 15th is relatively new. i guess ill have to re-write against the API and keep this version for everyone on older versions of manageiq/cfme who wont have access to the API

@Fryguy

This comment has been minimized.

Member

Fryguy commented Feb 23, 2018

We tried to backport to Fine (a.k.a. CF 5.8), but it was built on a lot of refactoring of the API code, and thus was too hard to backport.

@Fryguy

This comment has been minimized.

Member

Fryguy commented Feb 23, 2018

@bdunne or @carbonin Do you think you can take a look here and see if everything looks reasonable?

(update_value_rc, update_value_out, update_value_err) = module.run_command([
"rails",
"r",
"Vmdb::Settings.save!(MiqServer.my_server, :%s => JSON.parse(ARGV.last))" % (module.params['name']),

This comment has been minimized.

@carbonin

carbonin Feb 26, 2018

I think it would be better to use MiqServer.my_server.add_settings_for_resource(…) here. This will queue a settings reload for all workers running on the target server after save.

returncode, out, err = module.run_command([
"rails",
"r",
"puts MiqServer.my_server.get_config(:%s).config.to_json" % (name)

This comment has been minimized.

@carbonin

carbonin Feb 26, 2018

+1 for @cben's suggestion here.

I would think ::Settings.to_hash or MiqServer.my_server.settings_for_resource would be preferred here. I'm not sure which is the better way to go .. @Fryguy ?

@cben

This comment has been minimized.

Contributor

cben commented Mar 26, 2018

BTW, settings REST API currently can't round-trip symbol values without turning them into strings, which breaks all kinds of code that expected symbols
https://bugzilla.redhat.com/show_bug.cgi?id=1558031

Does this module have similar problem? It could in principle bypass it, as it goes through Ruby not REST API, but I think this implementation uses JSON between Ruby and Python and would also loss symbol/string distinction?

@itewk

This comment has been minimized.

itewk commented Apr 30, 2018

@cben in the couple months I have been using this with clients I have not run into any issues with the symbols. As you say, since going direct to ruby and running everything through parsers I think the issue going on with the REST API is avoided. If you have a specific scenario that you know doesn't work with the REST API could try it with this module.

@itewk itewk referenced this pull request Apr 30, 2018

Open

Delay on settings update #1

@cben

This comment has been minimized.

Contributor

cben commented May 2, 2018

Hi, didn't realize this is still stuck unmerged.

The symbols issue is mostly (but not completely) solved on master, but I don't think that's going to be backported, and the whole point of this module not using API was working with older manageiq.

To confirm symbols are not being converted to strings, could you run:

bundle exec rails runner 'puts Settings.to_hash.to_yaml'

before and after using the module, and diff the outputs?

@ansibot

This comment has been minimized.

Contributor

ansibot commented May 31, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E307 version_added should be 2.7. Currently 2.6

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Jun 8, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/remote_management/manageiq/manageiq_config.py:0:0: E307 version_added should be 2.7. Currently 2.6

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment