copr-builders: fix PyLint warnings for s390x spawner

This commit is contained in:
Pavel Raiskup 2022-01-08 15:01:06 +01:00
parent 75b2d1aee6
commit ab03757115

View file

@ -8,24 +8,23 @@ import argparse
import datetime import datetime
import logging import logging
import pipes import pipes
import re import os
import subprocess import subprocess
import sys import sys
from ibm_vpc import VpcV1 from ibm_vpc import VpcV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_sdk_core import ApiException
DEFAULT_PLAYBOOK = "{{ provision_directory }}/libvirt-provision.yml" DEFAULT_PLAYBOOK = "{{ provision_directory }}/libvirt-provision.yml"
DEFAULT_TOKEN_FILE = "/var/lib/resallocserver/.ibm-cloud-token" DEFAULT_TOKEN_FILE = "/var/lib/resallocserver/.ibm-cloud-token"
DEFAULT_IMAGE = "{{ copr_builder_images.ibm_cloud.s390x }}" DEFAULT_IMAGE = "{{ copr_builder_images.ibm_cloud.s390x }}"
subnet_id = "02f7-98674f68-aae1-4ea1-a889-5a0b7a07f4b8" SUBNET_ID = "02f7-98674f68-aae1-4ea1-a889-5a0b7a07f4b8"
vpc_id = "r022-8438169e-d881-4bda-b603-d31fdf0f8b3a" VPC_ID = "r022-8438169e-d881-4bda-b603-d31fdf0f8b3a"
security_group_id = "r022-bf49b90e-c00f-4c68-8707-2936b47b286b" SECURITY_GROUP_ID = "r022-bf49b90e-c00f-4c68-8707-2936b47b286b"
my_key_id = "r022-3918e368-8e00-4e23-9119-5e3ce1eb33bd" SSH_KEY_ID = "r022-3918e368-8e00-4e23-9119-5e3ce1eb33bd"
profile = "cz2-2x4" INSTANCE_TYPE = "cz2-2x4"
zone_name = "jp-tok-2" ZONE_NAME = "jp-tok-2"
def resalloc_to_ibmcloud_name(name): def resalloc_to_ibmcloud_name(name):
@ -86,11 +85,11 @@ def create_instance(service, instance_name, opts, log):
Start the VM, name it "instance_name" Start the VM, name it "instance_name"
""" """
instance_prototype_model = { instance_prototype_model = {
"keys": [{"id": my_key_id}], "keys": [{"id": SSH_KEY_ID}],
"name": instance_name, "name": instance_name,
"profile": {"name": profile}, "profile": {"name": INSTANCE_TYPE},
"vpc": { "vpc": {
"id": vpc_id, "id": VPC_ID,
}, },
"boot_volume_attachment": { "boot_volume_attachment": {
"volume": { "volume": {
@ -105,14 +104,14 @@ def create_instance(service, instance_name, opts, log):
"primary_network_interface": { "primary_network_interface": {
'name': 'primary-network-interface', 'name': 'primary-network-interface',
'subnet': { 'subnet': {
"id": subnet_id, "id": SUBNET_ID,
}, },
"security_groups": [ "security_groups": [
{"id": security_group_id}, {"id": SECURITY_GROUP_ID},
], ],
}, },
"zone": { "zone": {
"name": zone_name, "name": ZONE_NAME,
}, },
"volume_attachments": [{ "volume_attachments": [{
"volume": { "volume": {
@ -249,5 +248,4 @@ def _main():
if __name__ == "__main__": if __name__ == "__main__":
_main() _main()
# vi: ft=python # vi: ft=python