Skip to content

Conversation

@jcpage573
Copy link
Contributor

Makes it so if there isn't an environment section in the compose file it doesn't fail.

'NoneType' object is not iterable
Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.azure/cliextensions/containerapp/azext_containerapp/custom.py", line 1478, in create_containerapps_from_compose
    environment = resolve_environment_from_service(service)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/containerapp/_compose_utils.py", line 217, in resolve_environment_from_service
    env_vars = service.resolve_environment_hierarchy()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/pycomposefile/service/service.py", line 141, in resolve_environment_hierarchy
    env_file.update(self.environment)
TypeError: 'NoneType' object is not iterable```

@jcpage573 jcpage573 changed the title Update service.py Update pycomposefile Jan 16, 2025
@jcpage573 jcpage573 changed the title Update pycomposefile Update service Jan 16, 2025
@usepowershell usepowershell merged commit d6b1e7d into usepowershell:main Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants