-
Notifications
You must be signed in to change notification settings - Fork 85
[neutron][Cisco ACI]: Multiple VMM domain support (SOC - 10471) #1548
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
Changes from all commits
220ca18
cb5347d
303d986
5dcedf9
3e4b3c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,18 @@ | |
| end | ||
|
|
||
| aciswitches = node[:neutron][:apic][:apic_switches].to_hash | ||
| acivmms = node[:neutron][:apic][:apic_vmms] | ||
|
|
||
| # If using VMWare vcenter as one of the compute hosts. | ||
| # distributed dhcp and metadata cannot work since these | ||
| # functions conflict with vcenter functionality. | ||
| if acivmms.find { |vmm| vmm[:vmm_type].downcase == "vmware"} | ||
| apic_optimized_dhcp = false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/TrailingWhitespace: Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace) |
||
| apic_optimized_metadata = false | ||
| else | ||
| apic_optimized_dhcp = node[:neutron][:apic][:optimized_dhcp] | ||
| apic_optimized_metadata = node[:neutron][:apic][:optimized_metadata] | ||
| end | ||
|
|
||
| template node[:neutron][:ml2_cisco_apic_config_file] do | ||
| cookbook "neutron" | ||
|
|
@@ -51,6 +63,9 @@ | |
| variables( | ||
| vpc_pairs: node[:neutron][:apic][:vpc_pairs], | ||
| apic_switches: aciswitches, | ||
| optimized_dhcp: apic_optimized_dhcp, | ||
| optimized_metadata: apic_optimized_metadata, | ||
| apic_vmms: acivmms, | ||
| ml2_mechanism_drivers: node[:neutron][:ml2_mechanism_drivers], | ||
| policy_drivers: "implicit_policy,apic", | ||
| default_ip_pool: "192.168.0.0/16" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| def upgrade(tattr, tdep, attr, dep) | ||
| unless attr["apic"]["opflex"].key?("integration_bridge") | ||
| attr["apic"]["opflex"]["integration_bridge"] = tattr["apic"]["opflex"]["integration_bridge"] | ||
| end | ||
| unless attr["apic"]["opflex"].key?("access_bridge") | ||
| attr["apic"]["opflex"]["access_bridge"] = tattr["apic"]["opflex"]["access_bridge"] | ||
| end | ||
|
|
||
| return attr, dep | ||
| end | ||
|
|
||
| def downgrade(tattr, tdep, attr, dep) | ||
| unless tattr["apic"]["opflex"].key?("integration_bridge") | ||
| attr["apic"]["opflex"].delete("integration_bridge") if attr.key?("integration_bridge") | ||
| end | ||
| unless tattr["apic"]["opflex"].key?("access_bridge") | ||
| attr["apic"]["opflex"].delete("access_bridge") if attr.key?("access_bridge") | ||
| end | ||
|
|
||
| return attr, dep | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| def upgrade(tattr, tdep, attr, dep) | ||
| unless attr["apic"].key?("apic_vmms") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/IfUnlessModifier: Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||. (https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier) |
||
| attr["apic"]["apic_vmms"] = tattr["apic"]["apic_vmms"] | ||
| end | ||
|
|
||
| return attr, dep | ||
| end | ||
|
|
||
| def downgrade(tattr, tdep, attr, dep) | ||
| unless tattr["apic"].key?("apic_vmms") | ||
| attr["apic"].delete("apic_vmms") if attr.key?("apic_vmms") | ||
| end | ||
|
|
||
| return attr, dep | ||
| 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.
Performance/Casecmp: Use casecmp instead of downcase ==. (https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code)
Layout/SpaceInsideBlockBraces: Space missing inside }.