Commit 01bd68ff authored by Matthieu Lamalle's avatar Matthieu Lamalle

update pillar creation with creole_files

parent 7f24b43a
Pipeline #464 passed with stage
in 0 seconds
......@@ -67,7 +67,7 @@ RUN curl https://repo.saltstack.com/apt/ubuntu/18.04/amd64/2018.3/SALTSTACK-GPG-
ENV EOLE_FORMULA_DIR=/srv/formulas
ENV EOLE_CONFIGURATION_FORMULA_URL="https://dev-eole.ac-dijon.fr/git/eole-configuration-formula.git"
ENV EOLE_CONFIGURATION_FORMULA_REF=cf2f8908a815513dcd9771cea98c3754257f801b
ENV EOLE_CONFIGURATION_FORMULA_REF=80a799e758a4b660b1fce54909b1db5833b9a661
RUN git clone "${EOLE_CONFIGURATION_FORMULA_URL}" "${EOLE_FORMULA_DIR}/eole-configuration-formula" \
&& cd "${EOLE_FORMULA_DIR}/eole-configuration-formula" \
......
......@@ -165,12 +165,12 @@ class SaltRunner(ZephirCommonController):
servermodel_id = server['servermodelid']
with open(pillar_file_path, 'w') as fh:
if server['configuration']:
if json.loads(server['configuration']):
yaml.dump(json.loads(server['configuration']), fh, allow_unicode=True)
else:
yaml.dump({}, fh)
fh.close()
del server
servermodel = await self.call('v1.servermodel.describe',
servermodelid=servermodel_id,
......@@ -200,10 +200,10 @@ class SaltRunner(ZephirCommonController):
eoleconfig['eole']['configuration']['files'][pathtofile]['owner'] = 'root'
eoleconfig['eole']['configuration']['files'][pathtofile]['group'] = 'root'
eoleconfig['eole']['configuration']['files'][pathtofile]['mode'] = mode
with open(pillar_file_path, 'a') as fh:
fh.write(yaml.dump(eoleconfig, default_flow_style=False))
if json.loads(server['configuration']):
with open(pillar_file_path, 'a') as fh:
fh.write(yaml.dump(eoleconfig, default_flow_style=False))
del server
self._download_env(server_id, servermodel)
def _download_env(self, server_id, servermodel):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment