Skip to content

Commit

Permalink
Merge pull request #278 from pvelumul/configpush_changes
Browse files Browse the repository at this point in the history
mangling names of node policies, rectifying the string concatenation …
  • Loading branch information
michsmit99 committed Jan 16, 2017
2 parents ab8673d + dd5efd3 commit f4368bc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions applications/configpush/apicservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ def name(self):
"""
return self._policy['name']

@name.setter
def name(self, value):
self._policy['name'] = value

@property
def ip(self):
"""
Expand Down Expand Up @@ -1199,7 +1203,7 @@ def push_remaining_contracts_along_with_filters(self, apic, THROTTLE_SIZE):
logging.debug('Throttling contracts. Pushing config...')
resp = tenant.push_to_apic(apic)
if not resp.ok:
return resp
return resp.content
tenant = Tenant(self._tenant_name)
if self.displayonly:
print json.dumps(tenant.get_json(), indent=4, sort_keys=True)
Expand Down Expand Up @@ -1746,9 +1750,12 @@ def mangle_names(self):
else:
epg_policy.name = epg_policy.replace_invalid_name_chars(epg_policy.name)
end_string = '-' + str(unique_id)
epg_policy.name = epg_policy.name[0:30 - len(end_string)] + end_string
epg_policy.name = epg_policy.name[0:27 - len(end_string)] + end_string
unique_id += 1
name_db_by_id[epg_policy.id] = epg_policy.name

for node_policy in epg_policy.get_node_policies():
node_policy.name = node_policy.replace_invalid_name_chars(node_policy.name)
for contract_policy in self.cdb.get_contract_policies():
contract_policy.descr = contract_policy.src_name + ':' + contract_policy.dst_name + '::'
contract_policy.descr += contract_policy.src_id + ':' + contract_policy.dst_id
Expand Down

0 comments on commit f4368bc

Please sign in to comment.