generate_emu_config: allow only have username in my_login.txt

This commit is contained in:
detiam 2024-11-05 11:24:46 +08:00
parent 8eac4b7898
commit cd146fa305
No known key found for this signature in database
GPG Key ID: 8F3FBE68AEB4883C

View File

@ -710,9 +710,10 @@ def main():
filedata = f.readlines() filedata = f.readlines()
filedata = list(map(lambda s: s.replace("\r", "").replace("\n", ""), filedata)) filedata = list(map(lambda s: s.replace("\r", "").replace("\n", ""), filedata))
filedata = [l for l in filedata if l] filedata = [l for l in filedata if l]
if len(filedata) == 2: if len(filedata) == 1:
USERNAME = filedata[0] USERNAME = filedata[0]
PASSWORD = filedata[1] elif len(filedata) == 2:
USERNAME, PASSWORD = filedata[0], filedata[1]
# then allow the env vars to override the login details # then allow the env vars to override the login details
env_username = os.environ.get('GSE_CFG_USERNAME', None) env_username = os.environ.get('GSE_CFG_USERNAME', None)