algosec-sdk 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56034524fe3048203cf77cd466bc6a5c3a4c8a2c
4
- data.tar.gz: aa9cdba1f2bdd438a30671d2e2369b39481f60c4
3
+ metadata.gz: 200b717290ccfad8a20da768a3c93400ac4ac7b6
4
+ data.tar.gz: eded38f3ba2af6afd8379da7f83d74e9107362c0
5
5
  SHA512:
6
- metadata.gz: 9c3424704a4cd59a987fdbec1bad9e8166bef1e55bc0610afeafbb6a63e58b5df73b464ca1ea6e6242173926fd5f3cac66c166118d67ccddddae201c9b858966
7
- data.tar.gz: 518c7ce35db30dbc3f752dc0e63371eb61f7cd3e60b80642595e4cfed9ffc169488c92f5508468ff736f6dfe68a45524f6858899bb0771596e033a67a9c9d505
6
+ metadata.gz: 77dd2bd60df9869a2632beeae3a6ce48dceb265476962cb9e6be33a333f55581b713a07f73ffc050978676733abc7bbfc3f21490f49ee1f80be74d7c4e64d36a
7
+ data.tar.gz: b302c868182f4ffe4cba82d44839a83b0d7e9ac42d86a9fd6bbb022eec9fc9875b0e997d0070bb8c8f438b16a5a2342ec51ba7a9c544047039ccb4f31fbe7e09
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.2.1
2
+ current_version = 1.2.2
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -9,7 +9,7 @@ Metrics/LineLength:
9
9
  Max: 120
10
10
 
11
11
  Metrics/ModuleLength:
12
- Max: 220
12
+ Max: 300
13
13
 
14
14
  Metrics/ParameterLists:
15
15
  Max: 6
@@ -366,8 +366,14 @@ module ALGOSEC_SDK
366
366
  # TODO: Add unitests that objects are being create only once (if the same object is twice in the incoming list)
367
367
  network_object_names = Set.new(network_object_names)
368
368
  ipv4_or_subnet_objects = network_object_names.map do |object_name|
369
- if get_network_object_type(object_name)
370
- search_network_object(object_name, NetworkObjectSearchType::EXACT).empty? ? object_name : nil
369
+ next unless get_network_object_type(object_name)
370
+ search_results = search_network_object(object_name, NetworkObjectSearchType::EXACT)
371
+ if search_results.empty?
372
+ # nothing was found, mark the object for creation
373
+ object_name
374
+ else
375
+ # if no object named the same way, mark it for creation
376
+ search_results.any? { |result| result['name'] == object_name } ? nil : object_name
371
377
  end
372
378
  end.compact
373
379
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Gem version defined here
4
4
  module ALGOSEC_SDK
5
- VERSION = '1.2.1'.freeze
5
+ VERSION = '1.2.2'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algosec-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Almog Cohen