1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

convert strings to python3 f-Strings

This commit is contained in:
catborise 2020-05-21 16:17:25 +03:00
parent 7864ca6e01
commit 3e5769fe2d
5 changed files with 121 additions and 124 deletions

View file

@ -4,14 +4,14 @@ from vrtManager.connection import wvmConnect
class wvmSecrets(wvmConnect):
def create_secret(self, ephemeral, private, secret_type, data):
xml = """<secret ephemeral='%s' private='%s'>
<usage type='%s'>""" % (ephemeral, private, secret_type)
xml = f"""<secret ephemeral='{ephemeral}' private='{private}'>
<usage type='{secret_type}'>"""
if secret_type == 'ceph':
xml += """<name>%s</name>""" % data
xml += f"""<name>{data}</name>"""
if secret_type == 'volume':
xml += """<volume>%s</volume>""" % data
xml += f"""<volume>{data}</volume>"""
if secret_type == 'iscsi':
xml += """<target>%s</target>""" % data
xml += f"""<target>{data}</target>"""
xml += """</usage>
</secret>"""
self.wvm.secretDefineXML(xml)