ripe-xylophone-26538
01/10/2024, 2:53 PMCalling __str__ on an Output[T] is not supported.
To get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v: f"prefix{v}suffix")
See <https://www.pulumi.com/docs/concepts/inputs-outputs> for more details.
This function may throw in a future version of Pulumi.
I've tried
registry_username = config.require_secret("registryUsername")
print(registry_username.apply(lambda v: f"{v}"))
ripe-xylophone-26538
01/10/2024, 3:59 PMripe-xylophone-26538
01/10/2024, 4:00 PMdef read_config():
with open("scraper.yaml", "r") as template:
yml = template.read()
yml = string.Template(yml)
yml = yml.substitute({"pg_host": pg_host,
"pg_user": pg_user,
"pg_admin_password": pg_admin_password,
"pg_database": pg_database,
"ssh_keys": ssh_key,
"ssh_port": ssh_port,
"host": subdomain + "." + domain,
"username": username,
"image_name": image_name,
"image_tag": image_tag,
"metabase_tag": metabase_tag,
"traefik_tag": traefik_tag,
"registry_server": registry_server,
"registry_username": registry_username.apply(lambda v: v),
"registry_password": registry_password})
with open("scraper.bu", "w") as butane:
butane.write(yml)
subprocess.run(["cat", "scraper.bu", "|", "butane", "-o", "scraper.ig", "--files-dir", "."],
shell=True,
capture_output=True)
with open("scraper.ig", "r") as ignition:
cfg = ignition.read()
return base64.b64encode(cfg)
This is basically what I need to run to get my ignition data for a flatcar vmripe-xylophone-26538
01/10/2024, 4:01 PMripe-xylophone-26538
01/10/2024, 4:32 PMsalmon-account-74572
01/10/2024, 9:50 PMsubprocess.run
, try using the Pulumi command
provider. It might help with understanding dependencies and resolving Outputs before executing the command.cuddly-computer-18851
01/10/2024, 10:08 PMpulumi.log
+ pulumi.interpolate if you want debug logs or whatever in your output.ripe-xylophone-26538
01/11/2024, 6:11 AMripe-xylophone-26538
01/11/2024, 6:15 AMcuddly-computer-18851
01/11/2024, 6:23 AMripe-xylophone-26538
01/11/2024, 6:24 AMimport pulumi
config = pulumi.Config()
base_name = "yobst-scraper"
location = config.get("location", "germanywestcentral")
username = "yobst"
ssh_key = config.get("sshKey")
ssh_port = 22
flatcar_version = "3602.2.3"
domain = config.get("domain", "germanywestcentral.cloudapp.azure.com")
subdomain = config.get("subdomain", "yobst-scraper")
pg_host = config.get("pgHost")
pg_user = "yobst"
pg_password = config.require_secret("pgPassword")
pg_admin_password = config.require_secret("pgAdminPassword")
pg_database = "scraper"
pg_sslmode = config.get_bool("pgSslMode", False)
pg_sslrootcert = config.require_secret("pgSslRootCert")
registry_server = "ghcr.io"
registry_username = config.require_secret("registryUsername")
registry_password = config.require_secret("registryPassword")
image_name = registry_server + "/yobst/" + base_name
image_tag = "0.1.09c1a77"
traefik_tag = "v3.0"
metabase_tag = "v0.48.1"
cuddly-computer-18851
01/11/2024, 6:25 AMconfig.get()
is a Stringripe-xylophone-26538
01/11/2024, 6:26 AMcuddly-computer-18851
01/11/2024, 6:26 AMripe-xylophone-26538
01/11/2024, 6:29 AMpulumi.error(str(type(registry_username)))
returns error: <class 'pulumi.output.Output'>
ripe-xylophone-26538
01/11/2024, 6:30 AMripe-xylophone-26538
01/11/2024, 6:31 AMssh_key
from aboveripe-xylophone-26538
01/11/2024, 6:32 AMget_secret
again returns Output
ripe-xylophone-26538
01/11/2024, 6:33 AMcuddly-computer-18851
01/11/2024, 6:45 AMcuddly-computer-18851
01/11/2024, 6:46 AMripe-xylophone-26538
01/11/2024, 6:59 AMripe-xylophone-26538
01/11/2024, 7:01 AMcuddly-computer-18851
01/11/2024, 7:28 AMcuddly-computer-18851
01/11/2024, 7:29 AMripe-xylophone-26538
01/11/2024, 7:29 AM