Skip to content

Commit

Permalink
Fixes #36686 - temporarily patch out Pulp dist hidden field
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou committed Aug 21, 2023
1 parent 05b73f7 commit d2c33fd
Show file tree
Hide file tree
Showing 214 changed files with 130,338 additions and 119,001 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ AllCops:
- node_modules/**/*
- Gemfile
- locale/action_names.rb
- lib/monkeys/remove_hidden_distribution.rb
Include:
- '**/*.rb'
- app/views/**/*.rabl
Expand Down
1 change: 1 addition & 0 deletions config/initializers/monkeys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
require 'monkeys/anemone'
require 'monkeys/ar_postgres_evr_t'
require 'monkeys/fx_sqlite_skip'
require 'monkeys/remove_hidden_distribution'
163 changes: 163 additions & 0 deletions lib/monkeys/remove_hidden_distribution.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
require 'pulp_rpm_client'
require 'pulp_container_client'
require 'pulp_ostree_client'
PulpRpmClient::RpmRpmDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmRpmDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmRpmDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'publication')
self.publication = attributes[:'publication']
end
end
end

PulpContainerClient::ContainerContainerDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'repository_version')
self.repository_version = attributes[:'repository_version']
end

if attributes.key?(:'private')
self.private = attributes[:'private']
end

if attributes.key?(:'description')
self.description = attributes[:'description']
end
end
end

PulpOstreeClient::OstreeOstreeDistribution.class_eval do
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeDistribution` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'base_path')
self.base_path = attributes[:'base_path']
end

if attributes.key?(:'content_guard')
self.content_guard = attributes[:'content_guard']
end

if attributes.key?(:'hidden')
self.hidden = attributes[:'hidden']
# Monkey-patch here. The rest of the initializer is copied from the library code.
#else
# self.hidden = false
end

if attributes.key?(:'pulp_labels')
if (value = attributes[:'pulp_labels']).is_a?(Hash)
self.pulp_labels = value
end
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'repository')
self.repository = attributes[:'repository']
end

if attributes.key?(:'repository_version')
self.repository_version = attributes[:'repository_version']
end
end
end
Loading

0 comments on commit d2c33fd

Please sign in to comment.