-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring available_os_types method for miq_ae_orchestrations. #12211
Refactoring available_os_types method for miq_ae_orchestrations. #12211
Conversation
@miq-bot add_labels automate, enhancement |
@miq-bot add_label refactoring |
@@ -1,28 +1,46 @@ | |||
# | |||
# Description: provide the dynamic list content from available operating systems | |||
# | |||
os_list = {'unknown' => '<Unknown>', 'linux' => 'Linux', 'windows' => 'Windows'} | |||
selected_os = 'unknown' | |||
class AvailableOsTypes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fryguy @pkomanek @gmcculloug
@Fryguy had a suggestion that the classes should be namespaced so that we don't have conflicts when testing. should we create the class name based on the path
e.g. for this one ManageIQ::Cloud::Orchestration::Operations::AvailableOsTypes or
ManageIQ::Cloud::Orchestration::Operations::Methods::AvailableOsTypes.
@Fryguy please suggest.
Is the preferred way to have
module ManageIQ
module Cloud
module Orchestration
module Operations
module Methods
class AvailableOsTypes
end
...
end
or
module ManageIQ::Cloud::Orchestration::Operations::Methods
class AvailableOsTypes
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah I never sent the response @mkanoor :(
Although there are subtle differences, I would prefer the latter for readability.
Also, you should be careful in the ManageIQ namespace, because that is used by the ManageIQ::Api::Client
and will probably also be used by the various provider gems at some point. You might want to stuff it into a ManageIQ::Automate
top level namespace or something like that e.g:
module ManageIQ::Automate
module Cloud::Orchestration::Operations::Methods
class AvailableOsTypes
ennnd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkomanek
Can we follow Jason's suggestion and create everything with namespaces. The call at the bottom of the file and the specs would have to change.
@miq-bot add_label wip |
@mkanoor Could be like this? The namespaces are not in inline syntax, because in this case they are not created and I get back this error: |
@mkanoor I could create
|
@miq-bot remove_label wip |
Checked commits pkomanek/manageiq@099bc0c~...f49398d with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
Purpose or Intent
Refactoring the available_os_types method for the miq_ae_orchestration based on the issue bellow.
Links [Optional]
#12038