Skip to content

Commit

Permalink
zuul: add python-black job (#411)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt committed Dec 4, 2023
1 parent 80a69ef commit 47555b7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
- ansible-lint
- flake8
- hadolint
- python-black
- yamllint
- container-image-ceph-ansible-build-pacific
- container-image-ceph-ansible-build-quincy
Expand All @@ -95,12 +96,14 @@
- ansible-lint
- flake8
- hadolint
- python-black
- yamllint
periodic-daily:
jobs:
- ansible-lint
- flake8
- hadolint
- python-black
- yamllint
- container-image-ceph-ansible-push-pacific
- container-image-ceph-ansible-push-quincy
Expand Down
14 changes: 8 additions & 6 deletions files/src/render-python-requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
# render requirements.txt

template = environment.get_template("requirements.txt.j2")
result = template.render({
'ansible_version': ceph_versions['ansible_version'],
'ansible_core_version': ceph_versions['ansible_core_version'],
'osism_projects': versions['osism_projects'],
'version': VERSION,
})
result = template.render(
{
"ansible_version": ceph_versions["ansible_version"],
"ansible_core_version": ceph_versions["ansible_core_version"],
"osism_projects": versions["osism_projects"],
"version": VERSION,
}
)
with open("/requirements.txt", "w+") as fp:
fp.write(result)
30 changes: 16 additions & 14 deletions files/src/render-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,32 @@
template = environment.get_template("versions.yml.j2")

if VERSION == "latest":
result = template.render({
'ceph_ansible_version': CEPH_VERSION,
'ceph_image_version': CEPH_VERSION,
'cephclient_version': CEPH_VERSION
})
result = template.render(
{
"ceph_ansible_version": CEPH_VERSION,
"ceph_image_version": CEPH_VERSION,
"cephclient_version": CEPH_VERSION,
}
)
else:
with open("/release/%s/ceph.yml" % VERSION, "rb") as fp:
versions_ceph = yaml.load(fp, Loader=yaml.FullLoader)

result = template.render({
'ceph_ansible_version': versions['manager_version'],
'ceph_image_version': versions_ceph['docker_images']['ceph'],
'ceph_version': versions_ceph['ceph_version'],
'cephclient_version': versions_ceph['docker_images']['cephclient']
})
result = template.render(
{
"ceph_ansible_version": versions["manager_version"],
"ceph_image_version": versions_ceph["docker_images"]["ceph"],
"ceph_version": versions_ceph["ceph_version"],
"cephclient_version": versions_ceph["docker_images"]["cephclient"],
}
)

with open("/ansible/group_vars/all/versions.yml", "w+") as fp:
fp.write(result)

# render motd

template = environment.get_template("motd.j2")
result = template.render({
'manager_version': versions['manager_version']
})
result = template.render({"manager_version": versions["manager_version"]})
with open("/etc/motd", "w+") as fp:
fp.write(result)

0 comments on commit 47555b7

Please sign in to comment.