Skip to content

Commit

Permalink
meta: fix snap.yaml app slots (#3959)
Browse files Browse the repository at this point in the history
Add missing slots definition in snap.yaml apps.

Signed-off-by: Claudio Matsuoka <[email protected]>
  • Loading branch information
cmatsuoka authored Oct 25, 2022
1 parent 44e7644 commit 2d09913
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snapcraft/meta/snap_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Config:
restart_condition: Optional[str]
install_mode: Optional[str]
plugs: Optional[List[str]]
slots: Optional[List[str]]
aliases: Optional[List[str]]
environment: Optional[Dict[str, Any]]
command_chain: Optional[List[str]]
Expand Down Expand Up @@ -326,6 +327,7 @@ def _create_snap_app(app: App, assumes: Set[str]) -> SnapApp:
restart_condition=app.restart_condition,
install_mode=app.install_mode,
plugs=app.plugs,
slots=app.slots,
aliases=app.aliases,
environment=app.environment,
command_chain=app.command_chain or None,
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/meta/test_snap_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def complex_project():
restart-condition: on-success
install-mode: enable
aliases: [test-alias-1, test-alias-2]
plugs: [test-plug-1, test-plug-2]
slots: [test-slot-1, test-slot-2]
environment:
APP_VARIABLE: test-app-variable
command-chain:
Expand Down Expand Up @@ -264,6 +266,12 @@ def test_complex_snap_yaml(complex_project, new_dir):
stop-mode: sigterm
restart-condition: on-success
install-mode: enable
plugs:
- test-plug-1
- test-plug-2
slots:
- test-slot-1
- test-slot-2
aliases:
- test-alias-1
- test-alias-2
Expand Down

0 comments on commit 2d09913

Please sign in to comment.