-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inventory source misc bug fixes (#917)
* DeviceModel: fix port type to 'int' Signed-off-by: LucaNicosia <[email protected]> * native source: do not set up default port The default port must be set up depending on the device data, which is not accessible within the source. The default port assignment will be performed in the function `set_device` of base_source Signed-off-by: LucaNicosia <[email protected]> * base_source: default port + inventory keys fix Sometimes sources doesn't return the device port: - netbox: never return the port - native: if not specified on the host If the port is not specified, the inventory key (which is computed using namespace, address and port) will be incomplete. In order to fix this issue, we correctly set the port to these items and recreate the keys with the correct port Signed-off-by: LucaNicosia <[email protected]> * new tests + test fixes Signed-off-by: LucaNicosia <[email protected]> * unrelated test fix this test passes locally, but somehow it doesn't on github. setting the env-var to an empty value should fix this issue Signed-off-by: LucaNicosia <[email protected]> --------- Signed-off-by: LucaNicosia <[email protected]>
- Loading branch information
1 parent
091d784
commit eddb708
Showing
9 changed files
with
146 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,15 @@ auths: | |
password: strong-passoword | ||
key-passphrase: null | ||
type: null | ||
username: null | ||
username: user | ||
devices: | ||
dev0: | ||
devtype: null | ||
ignore-known-hosts: false | ||
jump-host: [email protected] | ||
jump-host-key-file: null | ||
name: dev0 | ||
port: null | ||
port: 333 | ||
slow-host: False | ||
per-cmd-auth: False | ||
retries-on-auth-fail: 0 | ||
|
@@ -24,28 +24,52 @@ namespaces: | |
device: dev0 | ||
name: native-ns | ||
source: native0 | ||
- auth: auth0 | ||
device: null | ||
name: native-default | ||
source: native-default | ||
- auth: auth0 | ||
device: null | ||
name: netbox-ns | ||
source: netbox0 | ||
sources: | ||
native-default: | ||
hosts: | ||
- address: 192.168.1.2 | ||
devtype: eos | ||
keyfile: null | ||
password: null | ||
port: null | ||
transport: https | ||
url: https://192.168.1.2 devtype=eos | ||
username: null | ||
- address: 192.168.1.3 | ||
devtype: null | ||
keyfile: null | ||
password: null | ||
port: null | ||
transport: ssh | ||
url: ssh://192.168.1.3 | ||
username: null | ||
name: native-default | ||
type: null | ||
native0: | ||
hosts: | ||
- address: 192.168.123.164 | ||
devtype: eos | ||
keyfile: null | ||
password: null | ||
port: 443 | ||
port: null | ||
transport: https | ||
url: https://[email protected] devtype=eos | ||
username: vagrant | ||
- address: 192.168.123.70 | ||
devtype: null | ||
keyfile: null | ||
password: null | ||
port: 22 | ||
port: 123 | ||
transport: ssh | ||
url: ssh://192.168.123.70 username=admin | ||
url: ssh://192.168.123.70:123 username=admin | ||
username: admin | ||
name: native0 | ||
type: null | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,38 @@ sources: | |
- name: native0 | ||
hosts: | ||
- url: https://[email protected] devtype=eos | ||
- url: ssh://192.168.123.70 username=admin | ||
- url: ssh://192.168.123.70:123 username=admin | ||
- name: netbox0 | ||
type: netbox | ||
token: MY-TOKEN | ||
url: http://localhost:8000 | ||
tag: suzieq | ||
- name: native-default | ||
hosts: | ||
- url: https://192.168.1.2 devtype=eos | ||
- url: ssh://192.168.1.3 | ||
|
||
auths: | ||
- name: auth0 | ||
password: plain:strong-passoword | ||
username: user | ||
|
||
devices: | ||
- name: dev0 | ||
transport: ssh | ||
jump-host: [email protected] | ||
per-cmd-auth: False | ||
retries-on-auth-fail: 0 | ||
port: 333 | ||
|
||
namespaces: | ||
- name: native-ns | ||
device: dev0 | ||
auth: auth0 | ||
source: native0 | ||
- name: native-default | ||
auth: auth0 | ||
source: native-default | ||
- name: netbox-ns | ||
auth: auth0 | ||
source: netbox0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.