From b7a8e73aa07aee022596f04a52d7f65bc318016e Mon Sep 17 00:00:00 2001 From: Max Brenner Date: Thu, 4 Nov 2021 14:16:03 +0100 Subject: [PATCH] add minor quali workflow fixes --- .github/workflows/quali.yml | 6 +++--- .quali/get_configuration.py | 29 +++++++++++++---------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/quali.yml b/.github/workflows/quali.yml index b85d9d652..6a315e811 100644 --- a/.github/workflows/quali.yml +++ b/.github/workflows/quali.yml @@ -46,8 +46,8 @@ on: description: 'the AP models to test' ap_version: required: true - default: 'latest' - description: 'revision of firmware to flash on AP, - | latest' + default: 'next-latest' + description: 'revision of firmware to flash on AP, -' jobs: vars: @@ -71,7 +71,7 @@ jobs: echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'main' }}") echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'main' }}") echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'EC420,EAP101,ECW5211,ECW5410' }}") - echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'latest' }}") + echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'next-latest' }}") generate-matrix: name: generate AP model matrix diff --git a/.quali/get_configuration.py b/.quali/get_configuration.py index c45dbfd00..f0ac29e99 100644 --- a/.quali/get_configuration.py +++ b/.quali/get_configuration.py @@ -5,6 +5,17 @@ from cloudshell.api.cloudshell_api import UpdateTopologyGlobalInputsRequest, Upd from common import get_session +def get_attribute_value(cloudshell_session, attribute): + if attribute.Type == 'Boolean': + return True if attribute.Value == 'True' else False + elif attribute.Type == 'Numeric': + return int(attribute.Value) + elif attribute.Type == 'Password': + return cloudshell_session.DecryptPassword(attribute.Value).Value + else: + return attribute.Value + + def main(): session = get_session() res_id = sys.argv[1] @@ -38,14 +49,7 @@ def main(): key = 'username' if key == 'uname' else key key = 'password' if key == 'passkey' else key - if attribute.Type == 'Boolean': - value = True if attribute.Value == 'True' else False - elif attribute.Type == 'Numeric': - value = int(attribute.Value) - else: - value = attribute.Value - - ap_config[key] = value + ap_config[key] = get_attribute_value(session, attribute) config['access_point'].append(ap_config) @@ -55,14 +59,7 @@ def main(): for attribute in details.ResourceAttributes: key = attribute.Name.replace(f"{resource.ResourceModelName}.", '') - if attribute.Type == 'Boolean': - value = True if attribute.Value == 'True' else False - elif attribute.Type == 'Numeric': - value = int(attribute.Value) - else: - value = attribute.Value - - tf_config[key] = value + tf_config[key] = get_attribute_value(session, attribute) config['traffic_generator'] = { 'name': 'lanforge',