Fix vdcmgr dhcp show #618

Merged
merged 2 commits into from Jun 15, 2015

Projects

None yet

3 participants

@Metallion
Member

Same as #595 but merging to develop instead of master.

unakatsuo added some commits May 29, 2015
@unakatsuo unakatsuo vdc-manage: fix "network dhcp show" which was showing incomplete range. 8a67a64
@unakatsuo unakatsuo vdc-manage: fix useless type conversion.
ef69897
@Metallion Metallion merged commit f9fe3ca into develop Jun 15, 2015

7 of 8 checks passed

wakame-ci/lxc.smoke.allowed-failure The build was failure on wakame-ci #23420 (ef69897a).
wakame-ci/dummy.smoke The build was success on wakame-ci #23414 (ef69897a).
wakame-ci/kvm.smoke The build was success on wakame-ci #23428 (ef69897a).
wakame-ci/kvm.smoke.allowed-failure The build was success on wakame-ci #23433 (ef69897a).
wakame-ci/rpmbuild The build was success on wakame-ci #23406 (ef69897a).
wakame-ci/rspec The build was success on wakame-ci #23403 (ef69897a).
wakame-ci/to-s3 The build was success on wakame-ci #23408 (ef69897a).
wakame-ci/vz.smoke The build was success on wakame-ci #23449 (ef69897a).
@Metallion Metallion deleted the fix-vdcmgr-dhcp-show branch Jun 15, 2015
@hansode hansode commented on the diff Jul 6, 2015
dcmgr/lib/dcmgr/cli/network.rb
@@ -834,16 +834,16 @@ def show(uuid=nil)
Network UUID:
<%= nw.canonical_uuid %>
Dynamic IP Address Range:
-<%- unless nw.ipv4_u32_dynamic_range_array.empty? -%>
- <%= IPAddress::IPv4::parse_u32(nw.ipv4_u32_dynamic_range_array.shift) %> - <%= IPAddress::IPv4::parse_u32(nw.ipv4_u32_dynamic_range_array.last) %>
-<%- end -%>
+<%- nw.dhcp_range_dataset.each { |r| -%>
+ <%= r.range_begin.to_s %> - <%= r.range_end.to_s %>
+<%- }
@hansode
hansode Jul 6, 2015 Member

%> is needed...

@hansode hansode commented on the diff Jul 6, 2015
dcmgr/lib/dcmgr/cli/network.rb
__END
else
cond = {}
nw = M::Network.filter(cond).all
print ERB.new(<<__END, nil, '-').result(binding)
<%- nw.each { |row| -%>
-<%= row.canonical_uuid %>\t<%= IPAddress::IPv4::parse_u32(row.ipv4_u32_dynamic_range_array.shift) %>\t<%= IPAddress::IPv4::parse_u32(row.ipv4_u32_dynamic_range_array.last) %>
+<%= row.canonical_uuid %>\t<%= r.dhcp_range_dataset.count %>
@hansode
hansode Jul 6, 2015 Member

r is undefined.

@hansode
hansode Jul 6, 2015 Member

it must keep output format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment