Skip to content

Commit

Permalink
Strip slashes from partition to ensure coherence, fix the irule exist…
Browse files Browse the repository at this point in the history
…ence test
  • Loading branch information
bastien-jove-cbp committed May 21, 2019
1 parent ebac8c5 commit 693cbda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libraries/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def initialize(node, resource, load_balancer, partition)
@node = node
@resource = resource
@load_balancer = load_balancer
@partition = partition
@partition = partition[%r{/?([^/]+)/?},1]

# local module aliases reduce repetetive call chains
@ProfileContextType = F5::Icontrol::LocalLB::ProfileContextType
Expand All @@ -17,7 +17,7 @@ def initialize(node, resource, load_balancer, partition)
private

def strip_partition(key)
key.gsub(%r{^/Common/}, '') if key
key.gsub(%r{^/#{@partition}/}, '') if key
end

def with_partition(key)
Expand Down
2 changes: 1 addition & 1 deletion resources/irule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
actual_irule_name = new_resource.irule_name || new_resource.name
irule = ChefF5::IRule.new(node, new_resource, new_resource.load_balancer, new_resource.partition)

if irule.is_missing?(actual_irule_name)
if irule.missing?(actual_irule_name)
converge_by "Create IRule #{actual_irule_name}" do
irule.create(actual_irule_name, new_resource.definition)
return
Expand Down

0 comments on commit 693cbda

Please sign in to comment.