fixup: snap & autoinstall
This commit is contained in:
parent
e41851765e
commit
3de314a64f
|
@ -340,25 +340,8 @@
|
||||||
},
|
},
|
||||||
"classic": {
|
"classic": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
|
||||||
"is_classic": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"classic"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"is_classic"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"required": [
|
"required": [
|
||||||
"name"
|
"name"
|
||||||
],
|
],
|
||||||
|
|
|
@ -51,7 +51,7 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -74,6 +74,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -61,6 +61,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -35,6 +35,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -102,6 +102,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -61,6 +61,6 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
|
@ -34,7 +34,7 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ SnapList:
|
||||||
snaps:
|
snaps:
|
||||||
hello:
|
hello:
|
||||||
channel: stable
|
channel: stable
|
||||||
is_classic: false
|
classic: false
|
||||||
InstallProgress:
|
InstallProgress:
|
||||||
reboot: yes
|
reboot: yes
|
||||||
|
|
||||||
|
|
|
@ -332,7 +332,7 @@ class SnapInfo:
|
||||||
class SnapSelection:
|
class SnapSelection:
|
||||||
name: str
|
name: str
|
||||||
channel: str
|
channel: str
|
||||||
is_classic: bool = False
|
classic: bool = False
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
|
|
|
@ -100,7 +100,7 @@ class SnapListModel:
|
||||||
cmds = []
|
cmds = []
|
||||||
for selection in self.selections:
|
for selection in self.selections:
|
||||||
cmd = ['snap', 'install', '--channel=' + selection.channel]
|
cmd = ['snap', 'install', '--channel=' + selection.channel]
|
||||||
if selection.is_classic:
|
if selection.classic:
|
||||||
cmd.append('--classic')
|
cmd.append('--classic')
|
||||||
cmd.append(selection.name)
|
cmd.append(selection.name)
|
||||||
cmds.append(' '.join(cmd))
|
cmds.append(' '.join(cmd))
|
||||||
|
|
|
@ -124,18 +124,7 @@ class SnapListController(SubiquityController):
|
||||||
'name': {'type': 'string'},
|
'name': {'type': 'string'},
|
||||||
'channel': {'type': 'string'},
|
'channel': {'type': 'string'},
|
||||||
'classic': {'type': 'boolean'},
|
'classic': {'type': 'boolean'},
|
||||||
'is_classic': {'type': 'boolean'},
|
|
||||||
},
|
},
|
||||||
'oneOf': [
|
|
||||||
{
|
|
||||||
'type': 'object',
|
|
||||||
'required': ['classic'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'type': 'object',
|
|
||||||
'required': ['is_classic'],
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'required': ['name'],
|
'required': ['name'],
|
||||||
'additionalProperties': False,
|
'additionalProperties': False,
|
||||||
},
|
},
|
||||||
|
@ -159,7 +148,7 @@ class SnapListController(SubiquityController):
|
||||||
to_install.append(SnapSelection(
|
to_install.append(SnapSelection(
|
||||||
name=snap['name'],
|
name=snap['name'],
|
||||||
channel=snap.get('channel', 'stable'),
|
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)
|
self.model.set_installed_list(to_install)
|
||||||
|
|
||||||
def snapd_network_changed(self):
|
def snapd_network_changed(self):
|
||||||
|
|
|
@ -128,7 +128,7 @@ class SnapInfoView(WidgetWrap):
|
||||||
selection = SnapSelection(
|
selection = SnapSelection(
|
||||||
name=self.snap.name,
|
name=self.snap.name,
|
||||||
channel=csi.channel_name,
|
channel=csi.channel_name,
|
||||||
is_classic=csi.confinement == "classic")
|
classic=csi.confinement == "classic")
|
||||||
btn = StarRadioButton(
|
btn = StarRadioButton(
|
||||||
radio_group,
|
radio_group,
|
||||||
csi.channel_name,
|
csi.channel_name,
|
||||||
|
@ -328,7 +328,7 @@ class SnapCheckBox(CheckBox):
|
||||||
self.parent.selections_by_name[self.snap.name] = SnapSelection(
|
self.parent.selections_by_name[self.snap.name] = SnapSelection(
|
||||||
name=self.snap.name,
|
name=self.snap.name,
|
||||||
channel='stable',
|
channel='stable',
|
||||||
is_classic=self.snap.confinement == "classic")
|
classic=self.snap.confinement == "classic")
|
||||||
else:
|
else:
|
||||||
log.debug("unselecting %s", self.snap.name)
|
log.debug("unselecting %s", self.snap.name)
|
||||||
self.parent.selections_by_name.pop(self.snap.name, None)
|
self.parent.selections_by_name.pop(self.snap.name, None)
|
||||||
|
|
Loading…
Reference in New Issue