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

juise should set context variables correctly #17

Closed
philshafer opened this issue May 27, 2015 · 1 comment
Closed

juise should set context variables correctly #17

philshafer opened this issue May 27, 2015 · 1 comment
Assignees
Labels

Comments

@philshafer
Copy link
Contributor

>2.  Is there not a way to access the predefined $product or $hostname param=
>eters like we can when using slax on-box?

The junos-context is set, but mostly empty.  "host-name", "product", "localtime",
"localtime-iso", and "script-type" are there; product is "juise":

<op-script-input xmlns:junos="http://xml.juniper.net/junos/*/junos">
  <junos-context>
    <host-name>bock.juniper.net</host-name>
    <product>juise</product>
    <localtime>Wed May 27 08:34:15 2015</localtime>
    <localtime-iso>2015-05-27 08:34:15 EDT</localtime-iso>
    <script-type>op</script-type>
    <user-context>
      <user>phil</user>
      <uid>501</uid>
      <op-context/>
      <arguments>
        <argument>/Users/phil/work/root/bin/juise</argument>
        <argument>-d</argument>
        <argument>/Users/phil/trash/topology-ospf.slax</argument>
      </arguments>
    </user-context>
  </junos-context>
</op-script-input>

Looks like I'm missing the plumbing to pull this into the script.  juise
should do this automatically, but you can fake it using:

var $junos-context = /op-script-input/junos-context;
var $host-name = $junos-context/host-name;
var $product = $junos-context/product;
@philshafer philshafer self-assigned this May 27, 2015
@philshafer philshafer added the bug label May 27, 2015
@philshafer
Copy link
Contributor Author

juise now makes full junos-context.

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

No branches or pull requests

1 participant