aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/extraconfig/all_nodes
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-02 13:32:49 +0000
committerGerrit Code Review <review@openstack.org>2017-02-02 13:32:49 +0000
commita6522190b36401e494338ad4c91909b61168759d (patch)
treec424bf51a1f5fa88ed4a4d9ff9f6c89900a2dcc6 /puppet/extraconfig/all_nodes
parent3474673e39339924e7725de6a70add2d8c0078cb (diff)
parentb0f964d5475d21e7778e1ff5c2007b45383b5619 (diff)
Merge "Temporary UCSM mapping files should be opened with write mode"
Diffstat (limited to 'puppet/extraconfig/all_nodes')
-rw-r--r--puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml8
1 files changed, 6 insertions, 2 deletions
diff --git a/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml b/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml
index cb8d498c..9b900bc4 100644
--- a/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml
+++ b/puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml
@@ -245,7 +245,9 @@ resources:
for map_name in mappings:
f_name = '/root/' + map_name
map_data = os.getenv(map_name, "Nada")
- with open(f_name, 'a') as f:
+ with os.fdopen(os.open(f_name,
+ os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o644),
+ 'w') as f:
f.write(map_data)
if map_data is not "Nada":
if map_name is not 'nexus_config':
@@ -260,7 +262,9 @@ resources:
for mac in vals[1:]:
mac2host[mac.lower()] = vals[0]
- with open('/root/mac2host', 'a') as f:
+ with os.fdopen(os.open('/root/mac2host',
+ os.O_CREAT | os.O_TRUNC | os.O_WRONLY, 0o644),
+ 'w') as f:
f.write(str(mac2host))
# now we have mac to host, map host to switchport in hieradata