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

junos.load state module documentation is incorrect #119

Open
rsmekala opened this issue May 2, 2019 · 2 comments
Open

junos.load state module documentation is incorrect #119

rsmekala opened this issue May 2, 2019 · 2 comments

Comments

@rsmekala
Copy link

rsmekala commented May 2, 2019

Description of Issue/Question

The current state example provided doesn't work is incorrect.

➜ salt 'vmx' state.apply junos_load
[WARNING ] /Users/rsmekala/PycharmProjects/salt/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead.
  ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding)

vmx:
----------
          ID: Install the mentioned config
    Function: junos.load
      Result: False
     Comment: 
     Started: 12:07:25.098619
    Duration: 9.046 ms
     Changes:   
              ----------
              message:
                  Salt failed to render the template, please check file path and syntax.
                  Error: Path 'Install the mentioned config' is not absolute
              out:
                  False

Summary for vmx
------------
Succeeded: 0 (changed=1)
Failed:    1
------------
Total states run:     1
Total run time:   9.046 ms
ERROR: Minions returned with non-zero exit code

Will raise a PR fixing this.

@rsmekala
Copy link
Author

Junos.load with templates is broken. I tried out the sample state file and found it to be broken. I can't pinpoint the change that broke this, it probably is related to salt core changes.

Logs:

State file

salt://configs/interface.set:
  junos.load:
    - template_vars:
        interface_name: lo0
        description: Creating interface via SaltStack.

Template file:

set interfaces {{ interface_name }} unit 0

Logs:

➜ salt 'vmx' state.apply junos_load

vmx:
----------
          ID: salt://configs/interface.set
    Function: junos.load
      Result: False
     Comment: 
     Started: 15:08:02.181155
    Duration: 130.172 ms
     Changes:   
              ----------
              message:
                  Salt failed to render the template, please check file path and syntax.
                  Error: Jinja variable 'interface_name' is undefined
              out:

@rsmekala
Copy link
Author

Will verify if install_config has the same bug.

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

No branches or pull requests

1 participant