From 3d4b215b33da116fa0b0ba0f2db001cf6354c99d Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 15 Apr 2016 05:13:55 -0400 Subject: [PATCH] Fix issue 863: mac could not be assigned to docker container --- xCAT-server/lib/xcat/plugins/docker.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/docker.pm b/xCAT-server/lib/xcat/plugins/docker.pm index 7f4c1ad6a..b9ff4a16c 100755 --- a/xCAT-server/lib/xcat/plugins/docker.pm +++ b/xCAT-server/lib/xcat/plugins/docker.pm @@ -1078,6 +1078,10 @@ sub genreq_for_mkdocker { my ($node, $dockerhost, $method, $api) = @_; my $dockerinfo = $node_hash_variable{$node}; my %info_hash = (); + if (defined($dockerinfo->{flag})) { + my $flag_hash = decode_json($dockerinfo->{flag}); + %info_hash = %$flag_hash; + } #$info_hash{name} = '/'.$node; #$info_hash{Hostname} = ''; #$info_hash{Domainname} = ''; @@ -1089,11 +1093,6 @@ sub genreq_for_mkdocker { $info_hash{HostConfig}->{NetworkMode} = $dockerinfo->{nics}; $info_hash{NetworkDisabled} = JSON::false; $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{IPAMConfig}->{IPv4Address} = $dockerinfo->{ip}; - $info_hash{NetworkingConfig}->{EndpointsConfig}->{"$dockerinfo->{nics}"}->{MacAddress} = $dockerinfo->{mac}; - if (defined($dockerinfo->{flag})) { - my $flag_hash = decode_json($dockerinfo->{flag}); - %info_hash = (%info_hash, %$flag_hash); - } my $content = encode_json \%info_hash; return genreq($node, $dockerhost, $method, $api, $content); }