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
Profile description #254
Profile description #254
Conversation
@borod108 please review |
8efd515
to
f15b7bb
Compare
@pkliczewski Piotr, could you please review and Boris is in the training? |
end | ||
|
||
def get_profile_description(vnic_profile_name, network_name) | ||
vnic_profile_name + " (" + network_name + ")" |
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.
"#{vnic_profile_name} (#{network_name})"
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.
done
expect(@task.get_mac_address_of_nic_on_requested_vlan).to eq(mac_address) | ||
end | ||
|
||
it 'nics list does not contain a nic with the specified profile description' do |
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.
If I understand the test correctly, the "it" statement is actually a context - "it" should specify what is the expected result, while context describe in what context it happens. (same for previous "it")
@AlonaKaplan also codeclimet if possible... |
@AlonaKaplan @mwperina The code looks good. Let's fix codeclimate issues as @borod108 suggested. |
Regarding the codeclimate. There are two issues -
|
f15b7bb
to
2e112de
Compare
@miq-bot add_label blocker |
e1a6c4e
to
05354c6
Compare
end | ||
|
||
def parse_vnic_profile_id(requested_profile, uid_ems_cluster) | ||
if requested_profile.include?('(') |
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.
Can you please give a name to this? Because I am not sure it will be clear what having '(' means.
vlans = {} | ||
private_load_allowed_networks(vlans, uid_ems_cluster) | ||
matches = vlans.select { |_profile_id, profile_description| profile_description == requested_profile } | ||
return matches.keys[0] unless matches.empty? |
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.
Maybe use safe navigation?
05354c6
to
0d7c11e
Compare
'profile_id' or 'profile_name (network_name)' are both acceptable. Fixes https://bugzilla.redhat.com/1574351
0d7c11e
to
49f086a
Compare
Checked commit AlonaKaplan@49f086a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Profile description (cherry picked from commit 1c70679) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1584406
Gaprindashvili backport details:
|
Accept 'profile_name (network_name)' as a valid vlan of vm provision
'profile_id' or 'profile_name (network_name)' are both acceptable.
Fixes https://bugzilla.redhat.com/1574351