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

openvswitch_db: string key values causing not idempotent commands #55432

Closed
nmiletic opened this issue Apr 17, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@nmiletic
Copy link

commented Apr 17, 2019

SUMMARY

string key values causing not idempotent commands.
Double quotes are not stripped in map_config_to_obj leading to wrong key value in 'have'.

Maybe this can fix it:
<             col_value_to_dict[k.strip()] = v.strip().strip('\"')
---
>             col_value_to_dict[k.strip()] = v.strip()
root@ubuntu63:~/.ansible/tmp/ansible-tmp-1555491969.439463-157165670102828/debug_dir# python3 __main__.py  args

{"changed": true, "commands": ["/usr/bin/ovs-vsctl -t 5 set open_vswitch . other_config:pmd-cpu-mask=0xaaa00000000"], "invocation": {"module_args": {"table": "open_vswitch", "record": ".", "col": "other_config", "key": "pmd-cpu-mask", "value": "0xaaa00000000", "state": "present", "timeout": 5, "ovs-vsctl": "/usr/bin/ovs-vsctl"}}}
root@ubuntu63:~/.ansible/tmp/ansible-tmp-1555491969.439463-157165670102828/debug_dir# python3 __main__.py  args

{"changed": true, "commands": ["/usr/bin/ovs-vsctl -t 5 set open_vswitch . other_config:pmd-cpu-mask=0xaaa00000000"], "invocation": {"module_args": {"table": "open_vswitch", "record": ".", "col": "other_config", "key": "pmd-cpu-mask", "value": "0xaaa00000000", "state": "present", "timeout": 5, "ovs-vsctl": "/usr/bin/ovs-vsctl"}}}

(Pdb) p have
{'table': 'open_vswitch', 'record': '.', 'col': 'other_config', 'key': 'pmd-cpu-mask', 'value': '"0xaaa00000000"'}
(Pdb) p want
{'table': 'open_vswitch', 'record': '.', 'col': 'other_config', 'value': '0xaaa00000000', 'key': 'pmd-cpu-mask'}

ISSUE TYPE
  • Bug Report
COMPONENT NAME

openvswitch_db

ANSIBLE VERSION

ansible 2.9.0.dev0
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/nmiletic/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/nmiletic/src/ansible/lib/ansible
executable location = /home/nmiletic/src/ansible/bin/ansible
python version = 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]


##### CONFIGURATION
~/ansible$ ansible-config dump --only-changed
:~/ansible$

##### OS / ENVIRONMENT
Ubuntu 18.04


##### STEPS TO REPRODUCE
Run twice:

- name: set pmd-cpu-mask
  openvswitch_db:
    table: open_vswitch
    record: .
    col: other_config
    key: pmd-cpu-mask
    value: "0xaaa00000000"



##### EXPECTED RESULTS
Second run should not run the command.


##### ACTUAL RESULTS
Second run runs the command.

@nmiletic nmiletic changed the title string key values causing not idempotent commands openvswitch_db: string key values causing not idempotent commands Apr 17, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

@nmiletic, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@NilashishC NilashishC removed their assignment May 31, 2019

danielmellado added a commit to danielmellado/ansible that referenced this issue Jun 12, 2019

Fix ovsdb module not being idempotent
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432

danielmellado added a commit to danielmellado/ansible that referenced this issue Jun 12, 2019

Fix ovsdb module not being idempotent
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432

@danielmellado danielmellado self-assigned this Jun 12, 2019

danielmellado added a commit to danielmellado/ansible that referenced this issue Jun 12, 2019

Fix ovsdb module not being idempotent
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432

danielmellado added a commit to danielmellado/ansible that referenced this issue Jun 12, 2019

Fix ovsdb module not being idempotent
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432
Closes-bug: ansible#43858

StephenSorriaux pushed a commit to StephenSorriaux/ansible that referenced this issue Jun 26, 2019

Fix ovsdb module not being idempotent (ansible#57735)
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432
Closes-bug: ansible#43858

@sivel sivel removed the needs_triage label Jun 27, 2019

agowa338 added a commit to agowa338/ansible-1 that referenced this issue Jun 30, 2019

Fix ovsdb module not being idempotent (ansible#57735)
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: ansible#55432
Closes-bug: ansible#43858
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.