Skip to content

Conversation

@dgarros
Copy link
Contributor

@dgarros dgarros commented May 1, 2019

I noticed that juniper_junos_common/open_configuration wasn't respecting the ignore_warning parameter.

In our environment we were getting some error when 2 tasks are trying to run a config diff + check at the same time (even in private mode)

fatal: [rs1-aw38-c1-ash1 -> localhost]: FAILED! => changed=false
  msg: |-
    Unable to open the configuration in private mode: RpcError(severity: warning, bad_element: None, message: warning: changes cannot be committed while 'configure exclusive' is active
    warning: uncommitted changes will be discarded on exit)

Here is the task

     juniper_junos_config:
        retrieve: candidate
        load: overwrite
        config_mode: private
        diff: true
        check: true
        commit: false
        src: "{{ junos_conf }}"
        provider: "{{ credential }}"

there might be another issue here because we shouldn't have a lock on the configuration at this time since all tasks are running in private mode but I couldn't find where this lock was coming from so I fixed the ignore_arning issue...

Looking at the code, this parameter was not passed to the function but a default value was already defined for rpc.open_configuration

self.dev.rpc.open_configuration(
                        private=True,	                    
                        ignore_warning='uncommitted changes will be '	                       
                                       'discarded on exit')

This patch passed the ignore_warning arg to open_configuration and follow this logic:

  • if ignore_warning is a bool, pass the bool
  • if ignore_warning is a string, create a list and add it to the default value
  • if ignore_warning is a list, add the default value to the list

@jnpr-community-netdev
Copy link

Can one of the admins verify this patch?

1 similar comment
@jnpr-community-netdev
Copy link

Can one of the admins verify this patch?

@rsmekala
Copy link
Contributor

rsmekala commented Sep 5, 2019

ok to test

@rsmekala
Copy link
Contributor

rsmekala commented Sep 5, 2019

retest this please

Copy link
Contributor

@rsmekala rsmekala left a comment

Choose a reason for hiding this comment

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

LGTM. Will test it and merge it.

@rsmekala
Copy link
Contributor

rsmekala commented Sep 5, 2019

retest this please

@rsmekala rsmekala merged commit 11acaa3 into Juniper:master Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants