fixup: snap & autoinstall

This commit is contained in:
Dan Bungert 2021-09-22 17:45:58 -06:00
parent e41851765e
commit 3de314a64f
16 changed files with 16 additions and 44 deletions

View File

@ -340,25 +340,8 @@
},
"classic": {
"type": "boolean"
},
"is_classic": {
"type": "boolean"
}
},
"oneOf": [
{
"type": "object",
"required": [
"classic"
]
},
{
"type": "object",
"required": [
"is_classic"
]
}
],
"required": [
"name"
],

View File

@ -51,7 +51,7 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -26,7 +26,7 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -30,6 +30,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -74,6 +74,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -61,6 +61,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -35,6 +35,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -102,6 +102,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -61,6 +61,6 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -34,7 +34,7 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -34,7 +34,7 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -26,7 +26,7 @@ SnapList:
snaps:
hello:
channel: stable
is_classic: false
classic: false
InstallProgress:
reboot: yes

View File

@ -332,7 +332,7 @@ class SnapInfo:
class SnapSelection:
name: str
channel: str
is_classic: bool = False
classic: bool = False
@attr.s(auto_attribs=True)

View File

@ -100,7 +100,7 @@ class SnapListModel:
cmds = []
for selection in self.selections:
cmd = ['snap', 'install', '--channel=' + selection.channel]
if selection.is_classic:
if selection.classic:
cmd.append('--classic')
cmd.append(selection.name)
cmds.append(' '.join(cmd))

View File

@ -124,18 +124,7 @@ class SnapListController(SubiquityController):
'name': {'type': 'string'},
'channel': {'type': 'string'},
'classic': {'type': 'boolean'},
'is_classic': {'type': 'boolean'},
},
'oneOf': [
{
'type': 'object',
'required': ['classic'],
},
{
'type': 'object',
'required': ['is_classic'],
}
],
'required': ['name'],
'additionalProperties': False,
},
@ -159,7 +148,7 @@ class SnapListController(SubiquityController):
to_install.append(SnapSelection(
name=snap['name'],
channel=snap.get('channel', 'stable'),
is_classic=snap.get('classic', snap.get('is_classic', False))))
classic=snap.get('classic', False)))
self.model.set_installed_list(to_install)
def snapd_network_changed(self):

View File

@ -128,7 +128,7 @@ class SnapInfoView(WidgetWrap):
selection = SnapSelection(
name=self.snap.name,
channel=csi.channel_name,
is_classic=csi.confinement == "classic")
classic=csi.confinement == "classic")
btn = StarRadioButton(
radio_group,
csi.channel_name,
@ -328,7 +328,7 @@ class SnapCheckBox(CheckBox):
self.parent.selections_by_name[self.snap.name] = SnapSelection(
name=self.snap.name,
channel='stable',
is_classic=self.snap.confinement == "classic")
classic=self.snap.confinement == "classic")
else:
log.debug("unselecting %s", self.snap.name)
self.parent.selections_by_name.pop(self.snap.name, None)