Skip to content

Commit

Permalink
Add back .dup of params
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jun 22, 2023
1 parent d7db4f3 commit 270921d
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup
attrs[:auth_key] = attrs.delete(:security_token) if attrs.key?(:security_token)
attrs
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup
attrs[:auth_key] = attrs.delete(:secret) if attrs.key?(:secret)

if %i[client tenant subscription].any? {|opt| attrs.has_key? opt }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup

attrs[:auth_key] = attrs.delete(:ssh_key_data) if attrs.key?(:ssh_key_data)
attrs[:options] = { :project => attrs.delete(:project) } if attrs[:project]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup

attrs[:auth_key] = attrs.delete(:ssh_key_data) if attrs.key?(:ssh_key_data)
attrs[:auth_key_password] = attrs.delete(:ssh_key_unlock) if attrs.key?(:ssh_key_unlock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup

attrs[:auth_key] = attrs.delete(:ssh_key_data) if attrs.key?(:ssh_key_data)
attrs[:auth_key_password] = attrs.delete(:ssh_key_unlock) if attrs.key?(:ssh_key_unlock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup

if %i[host domain project].any? {|opt| attrs.has_key? opt }
attrs[:options] ||= {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup
attrs[:options] = { :host => attrs.delete(:host) } if attrs[:host]
attrs
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def self.display_name(number = 1)
alias vault_password password

def self.params_to_attributes(params)
attrs = super
attrs = super.dup
attrs[:password] = attrs.delete(:vault_password) if attrs.key?(:vault_password)
attrs
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.sup
attrs[:options] = { :host => attrs.delete(:host) } if attrs[:host]
attrs
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.display_name(number = 1)
end

def self.params_to_attributes(params)
attrs = super
attrs = super.dup

attrs[:auth_key] = attrs.delete(:ssh_key_data) if attrs.key?(:ssh_key_data)
attrs[:auth_key_password] = attrs.delete(:ssh_key_unlock) if attrs.key?(:ssh_key_unlock)
Expand Down

0 comments on commit 270921d

Please sign in to comment.