Skip to content

Commit

Permalink
Update runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
weiiwang01 committed Jun 18, 2023
1 parent 03ee22a commit 0a298e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ def _ensure_runner_profile(self) -> None:
if not self._clients.lxd.profiles.exists("runner"):
logger.info("Creating runner LXD profile")
profile_config = {}
profile_devices = {}
if _LXD_PROFILE_YAML.exists():
additional_configs = yaml.safe_load(_LXD_PROFILE_YAML.read_text())["config"]
profile_config.update({k: json.dumps(v) for k, v in additional_configs.items()})
self._clients.lxd.profiles.create("runner", profile_config, {})
additional_lxc_profile = yaml.safe_load(_LXD_PROFILE_YAML.read_text())
profile_config = {k: json.dumps(v) for k, v in additional_lxc_profile["config"].items()}
profile_devices = additional_lxc_profile["devices"]
self._clients.lxd.profiles.create("runner", profile_config, profile_devices)

# Verify the action is successful.
if not self._clients.lxd.profiles.exists("runner"):
Expand Down

0 comments on commit 0a298e8

Please sign in to comment.