Merge "Don't manipulate LoadBalancer template in-place"
This commit is contained in:
commit
39e06ae580
@ -11,6 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import functools
|
||||
import json
|
||||
import math
|
||||
@ -393,18 +394,16 @@ class InstanceGroup(stack_resource.StackResource):
|
||||
if inst.FnGetRefId() not in exclude]
|
||||
for lb in self.properties[self.LOAD_BALANCER_NAMES]:
|
||||
lb_resource = self.stack[lb]
|
||||
lb_defn = copy.deepcopy(lb_resource.t)
|
||||
if 'Instances' in lb_resource.properties_schema:
|
||||
lb_resource.json_snippet['Properties']['Instances'] = (
|
||||
id_list)
|
||||
lb_defn['Properties']['Instances'] = id_list
|
||||
elif 'members' in lb_resource.properties_schema:
|
||||
lb_resource.json_snippet['Properties']['members'] = (
|
||||
id_list)
|
||||
lb_defn['Properties']['members'] = id_list
|
||||
else:
|
||||
raise exception.Error(
|
||||
_("Unsupported resource '%s' in LoadBalancerNames") %
|
||||
(lb,))
|
||||
resolved_snippet = self.stack.resolve_static_data(
|
||||
lb_resource.json_snippet)
|
||||
resolved_snippet = self.stack.resolve_static_data(lb_defn)
|
||||
scheduler.TaskRunner(lb_resource.update, resolved_snippet)()
|
||||
|
||||
def FnGetRefId(self):
|
||||
|
@ -11,6 +11,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import re
|
||||
|
||||
import mock
|
||||
@ -190,7 +191,7 @@ class LoadBalancerTest(HeatTestCase):
|
||||
s)
|
||||
id_list.append(inst.FnGetRefId())
|
||||
|
||||
rsrc.handle_update(rsrc.json_snippet, {}, {'Instances': id_list})
|
||||
rsrc.handle_update(copy.deepcopy(rsrc.t), {}, {'Instances': id_list})
|
||||
|
||||
self.assertEqual('4.5.6.7', rsrc.FnGetAtt('DNSName'))
|
||||
self.assertEqual('', rsrc.FnGetAtt('SourceSecurityGroup.GroupName'))
|
||||
|
Loading…
Reference in New Issue
Block a user