@itentialopensource/adapter-openstack_neutron 0.1.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 2.0.0 [11-29-2022]
3
+
4
+ * Revert the bug in all paths
5
+
6
+ See merge request itentialopensource/adapters/cloud/adapter-openstack_neutron!2
7
+
8
+ ---
9
+
10
+ ## 1.0.0 [11-01-2022]
11
+
12
+ * Major/adapt 2415
13
+
14
+ See merge request itentialopensource/adapters/cloud/adapter-openstack_neutron!1
15
+
16
+ ---
17
+
2
18
  ## 0.1.1 [09-05-2022]
3
19
 
4
20
  * Bug fixes and performance improvements
@@ -6,4 +22,3 @@
6
22
  See commit 35ca066
7
23
 
8
24
  ---
9
-
package/adapterBase.js CHANGED
@@ -29,6 +29,7 @@ const troubleshootingAdapter = require(path.join(__dirname, 'utils/troubleshooti
29
29
  const tbUtils = require(path.join(__dirname, 'utils/tbUtils'));
30
30
 
31
31
  let propUtil = null;
32
+ let choosepath = null;
32
33
 
33
34
  /*
34
35
  * INTERNAL FUNCTION: force fail the adapter - generally done to cause restart
@@ -664,6 +665,9 @@ class AdapterBase extends EventEmitterCl {
664
665
  result.message = 'NO PATH PROVIDED!';
665
666
  return callback(null, result);
666
667
  }
668
+ if (typeof this.allProps.choosepath === 'string') {
669
+ choosepath = this.allProps.choosepath;
670
+ }
667
671
 
668
672
  // make sure the entities directory exists
669
673
  const entitydir = path.join(__dirname, 'entities');
@@ -689,7 +693,25 @@ class AdapterBase extends EventEmitterCl {
689
693
 
690
694
  // go through all of the actions set the appropriate info in the newActions
691
695
  for (let a = 0; a < actions.actions.length; a += 1) {
692
- if (actions.actions[a].entitypath.indexOf(apiPath) >= 0) {
696
+ if (actions.actions[a].entitypath && typeof actions.actions[a].entitypath === 'object') {
697
+ const entityKeys = Object.keys(actions.actions[a].entitypath);
698
+ if (entityKeys.length > 0) {
699
+ for (let entityKey = 0; entityKey < entityKeys.length; entityKey += 1) {
700
+ if (choosepath && entityKeys[entityKey] === choosepath && actions.actions[a].entitypath[entityKeys[entityKey]].indexOf(apiPath) >= 0) {
701
+ log.info(` Found - entity: ${entities[e]} action: ${actions.actions[a].name}`);
702
+ log.info(` method: ${actions.actions[a].method} path: ${actions.actions[a].entitypath[entityKeys[entityKey]]}`);
703
+ const fitem = {
704
+ entity: entities[e],
705
+ action: actions.actions[a].name,
706
+ method: actions.actions[a].method,
707
+ path: actions.actions[a].entitypath[entityKeys[entityKey]]
708
+ };
709
+ fitems.push(fitem);
710
+ break;
711
+ }
712
+ }
713
+ }
714
+ } else if (actions.actions[a].entitypath.indexOf(apiPath) >= 0) {
693
715
  log.info(` Found - entity: ${entities[e]} action: ${actions.actions[a].name}`);
694
716
  log.info(` method: ${actions.actions[a].method} path: ${actions.actions[a].entitypath}`);
695
717
  const fitem = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-openstack_neutron",
3
- "version": "0.1.1",
3
+ "version": "2.0.0",
4
4
  "description": "This adapter integrates with system described as: Openstack Networking (Neutron) Service",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Openstack Neutron",
@@ -55,7 +55,7 @@
55
55
  "author": "Itential",
56
56
  "homepage": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-openstack_neutron#readme",
57
57
  "dependencies": {
58
- "@itentialopensource/adapter-utils": "^4.47.0",
58
+ "@itentialopensource/adapter-utils": "^4.48.4",
59
59
  "ajv": "^6.12.0",
60
60
  "axios": "^0.21.0",
61
61
  "commander": "^2.20.0",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "1.0.0",
3
3
  "configLines": 19405,
4
4
  "scriptLines": 1707,
5
- "codeLines": 38924,
6
- "testLines": 19553,
5
+ "codeLines": 38946,
6
+ "testLines": 19555,
7
7
  "testCases": 997,
8
- "totalCodeLines": 60184,
8
+ "totalCodeLines": 60208,
9
9
  "wfTasks": 322
10
10
  }
@@ -5,6 +5,7 @@
5
5
  "host": "192.168.0.108",
6
6
  "port": 9696,
7
7
  "base_path": "",
8
+ "choosepath": "v0",
8
9
  "version": "",
9
10
  "cache_location": "none",
10
11
  "encode_pathvars": true,
@@ -46,6 +46,7 @@ samProps.ssl.accept_invalid_cert = false;
46
46
  samProps.request.attempt_timeout = 1200000;
47
47
  const attemptTimeout = samProps.request.attempt_timeout;
48
48
  const { stub } = samProps;
49
+ const { choosepath } = samProps;
49
50
 
50
51
  // these are the adapter properties. You generally should not need to alter
51
52
  // any of these after they are initially set up
@@ -988,6 +989,7 @@ describe('[unit] Openstack_neutron Adapter Test', () => {
988
989
  try {
989
990
  a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
990
991
  try {
992
+ console.log(error);
991
993
  assert.equal(undefined, error);
992
994
  assert.notEqual(undefined, data);
993
995
  assert.notEqual(null, data);