Skip to content

Commit

Permalink
Merge pull request #6 from nokia/coll-rename
Browse files Browse the repository at this point in the history
Renamed collection
  • Loading branch information
hellt authored Apr 23, 2023
2 parents 587f4ef + e583ada commit 910329e
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 41 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace: nokia

# The name of the collection. Has the same character restrictions as 'namespace'
name: srl
name: srlinux

# The version of the collection. Must be compatible with semantic versioning
version: 0.1.0
Expand Down
8 changes: 5 additions & 3 deletions plugins/modules/jsonrpc_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import random

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.nokia.srl.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srl.plugins.module_utils.const import JSON_RPC_VERSION
from ansible_collections.nokia.srlinux.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srlinux.plugins.module_utils.const import (
JSON_RPC_VERSION,
)

# pylint: disable=invalid-name
__metaclass__ = type
Expand Down Expand Up @@ -40,7 +42,7 @@

EXAMPLES = """
- name: Run \"show version\" CLI command
nokia.srl.jsonrpc_cli:
nokia.srlinux.jsonrpc_cli:
commands:
- show version
register: response
Expand Down
8 changes: 5 additions & 3 deletions plugins/modules/jsonrpc_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import random

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.nokia.srl.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srl.plugins.module_utils.const import JSON_RPC_VERSION
from ansible_collections.nokia.srlinux.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srlinux.plugins.module_utils.const import (
JSON_RPC_VERSION,
)

# pylint: disable=invalid-name
__metaclass__ = type
Expand Down Expand Up @@ -57,7 +59,7 @@

EXAMPLES = """
- name: Get /system/information container
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/jsonrpc_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import random

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.nokia.srl.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srl.plugins.module_utils.const import (
from ansible_collections.nokia.srlinux.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srlinux.plugins.module_utils.const import (
JSON_RPC_VERSION,
TEXT_FORMAT,
TOOLS_DATASTORE,
Expand Down Expand Up @@ -91,7 +91,7 @@

EXAMPLES = """
- name: Set system information with values
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand Down
8 changes: 5 additions & 3 deletions plugins/modules/jsonrpc_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import random

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.nokia.srl.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srl.plugins.module_utils.const import JSON_RPC_VERSION
from ansible_collections.nokia.srlinux.plugins.module_utils.srlinux import JSONRPCClient
from ansible_collections.nokia.srlinux.plugins.module_utils.const import (
JSON_RPC_VERSION,
)

# pylint: disable=invalid-name
__metaclass__ = type
Expand Down Expand Up @@ -78,7 +80,7 @@

EXAMPLES = """
- name: Validate a valid change set
nokia.srl.jsonrpc_validate:
nokia.srlinux.jsonrpc_validate:
update:
- path: /system/information
value:
Expand Down
6 changes: 3 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function deploy-lab {
# Prepare local dev environment by setting the symlink to the collection.
function prepare-dev-env {
# setup the symlink for ansible to resolve collection paths
rm -f /tmp/srl_ansible_dev/ansible_collections/nokia/srl
rm -f /tmp/srl_ansible_dev/ansible_collections/nokia/srlinux
mkdir -p /tmp/srl_ansible_dev/ansible_collections/nokia
ln -s "$(pwd)" /tmp/srl_ansible_dev/ansible_collections/nokia/srl
ln -s "$(pwd)" /tmp/srl_ansible_dev/ansible_collections/nokia/srlinux

# setup .env file for python to resolve imports
echo "PYTHONPATH=$(realpath ~)/.ansible/collections:/tmp/srl_ansible_dev" > .env
Expand Down Expand Up @@ -231,7 +231,7 @@ function ci-test {
function sanity-test {
install-local-collection

cd ~/.ansible/collections/ansible_collections/nokia/srl
cd ~/.ansible/collections/ansible_collections/nokia/srlinux
ansible-test sanity --docker default -v "$@"
}

Expand Down
2 changes: 1 addition & 1 deletion tests/hosts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[clab]
clab-ansible-srl ansible_connection=ansible.netcommon.httpapi ansible_user=admin ansible_password=NokiaSrl1! ansible_network_os=nokia.srl.srlinux ansible_httpapi_ciphers=ECDHE-RSA-AES256-SHA
clab-ansible-srl ansible_connection=ansible.netcommon.httpapi ansible_user=admin ansible_password=NokiaSrl1! ansible_network_os=nokia.srlinux.srlinux ansible_httpapi_ciphers=ECDHE-RSA-AES256-SHA
2 changes: 1 addition & 1 deletion tests/playbooks/auth-fail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ansible_password: wrong
tasks:
- name: Get system information
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/backup-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- "/tmp/{{inventory_hostname}}.cfg.*"

- name: Get entire running config
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /
datastore: running
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/cli-show-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Run "show version" CLI command
nokia.srl.jsonrpc_cli:
nokia.srlinux.jsonrpc_cli:
commands:
- show version
register: response
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/cli-wrong-cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Run wrong CLI command
nokia.srl.jsonrpc_cli:
nokia.srlinux.jsonrpc_cli:
commands:
- show wrong
register: response
Expand Down
6 changes: 3 additions & 3 deletions tests/playbooks/delete-leaves.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
tasks:
# test preparation step
- name: Set system information with values
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
location: Some location
contact: Some contact

- name: Test Delete operation on leaf nodes
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
delete:
- path: /system/information/location
- path: /system/information/contact
Expand All @@ -26,7 +26,7 @@
var: delete_response

- name: Ensure leaves were deleted
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/get-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tasks:
# this task ensures that we can get information for a container
- name: Get /system/information container
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/get-wrong-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tasks:
# this task ensures that we fail with expected error when get is targeted to a wrong path
- name: Get wrong path
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/informations
datastore: state
Expand Down
4 changes: 2 additions & 2 deletions tests/playbooks/replace-full-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Replace entire config from file
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
replace:
- path: /
value: "{{lookup('ansible.builtin.template', '{{playbook_dir}}/golden/{{inventory_hostname}}-golden.cfg.json.j2') }}"
Expand All @@ -19,7 +19,7 @@
var: set_response

- name: Ensure changes were made to the device
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /interface[name=ethernet-1/1]/description
datastore: state
Expand Down
6 changes: 3 additions & 3 deletions tests/playbooks/set-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Test check mode
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand All @@ -21,7 +21,7 @@
var: set_response

- name: Test check mode with diff
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand All @@ -36,7 +36,7 @@
var: set_response

- name: Ensure no changes were made to the device
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
8 changes: 4 additions & 4 deletions tests/playbooks/set-idempotent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Set system information with values
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand All @@ -20,7 +20,7 @@
var: set_response

- name: Ensure changes were made to the device
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand All @@ -31,7 +31,7 @@
var: get_response

- name: Repeated set should not run
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand All @@ -44,7 +44,7 @@
var: set_response

- name: Repeated set should not run with diff
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand Down
4 changes: 2 additions & 2 deletions tests/playbooks/set-leaves.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Set system information with values
nokia.srl.jsonrpc_set:
nokia.srlinux.jsonrpc_set:
update:
- path: /system/information
value:
Expand All @@ -19,7 +19,7 @@
var: set_response

- name: Ensure changes were made to the device
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/tls-missed-check-fail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ansible_httpapi_use_ssl: yes
tasks:
- name: json RPC get
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/tls-skipped-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ansible_httpapi_validate_certs: no
tasks:
- name: json RPC get
nokia.srl.jsonrpc_get:
nokia.srlinux.jsonrpc_get:
paths:
- path: /system/information
datastore: state
Expand Down
4 changes: 2 additions & 2 deletions tests/playbooks/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
gather_facts: false
tasks:
- name: Validate a valid change set
nokia.srl.jsonrpc_validate:
nokia.srlinux.jsonrpc_validate:
update:
- path: /system/information
value:
Expand All @@ -19,7 +19,7 @@
var: response

- name: Validate an invalid change set
nokia.srl.jsonrpc_validate:
nokia.srlinux.jsonrpc_validate:
update:
- path: /system/information
value:
Expand Down

0 comments on commit 910329e

Please sign in to comment.