From 9264e23631e28088a8c4799183ca782f57209ea1 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Thu, 25 Jan 2024 14:31:16 -0700 Subject: [PATCH 1/3] workflows: +noble --- .github/workflows/ci.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dee8ba25..5fa73c58 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,7 @@ jobs: - ubuntu-daily:jammy - ubuntu-daily:lunar - ubuntu-daily:mantic + - ubuntu-daily:noble steps: - uses: actions/checkout@v4 - name: run @@ -29,8 +30,8 @@ jobs: fail-fast: false matrix: image: - - ubuntu-daily:jammy # match the core snap we're running against - - ubuntu-daily:mantic # latest + - ubuntu-daily:jammy # match the core snap we're running against + - ubuntu-daily:noble # latest steps: - uses: actions/checkout@v4 - name: lint From 29b3f361d1cb11bcdac581df939f40680b1ac2bc Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 29 Jan 2024 12:29:07 -0700 Subject: [PATCH 2/3] scripts: handle cloud-init status 2 --- scripts/test-in-lxd.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/test-in-lxd.sh b/scripts/test-in-lxd.sh index 3fcfa2ac..df5f665c 100755 --- a/scripts/test-in-lxd.sh +++ b/scripts/test-in-lxd.sh @@ -45,7 +45,18 @@ then done fi -lxc exec $TESTER -- cloud-init status --wait +if ! lxc exec $TESTER -- cloud-init status --wait; then + ec=$? + case $ec in + 0|2) + # 2 is warnings + ;; + *) + echo "cloud-init status failed with $ec" + exit $ec + ;; + esac +fi lxc exec $TESTER -- sh -ec " cd ~/subiquity From a69532921664335c0f61072026e57411f00c75dd Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 29 Jan 2024 13:52:48 -0700 Subject: [PATCH 3/3] ui/identity: remove _AsyncValidatedMixin _AsyncValidatedMixin has been merged into the parent UsernameEditor, reluctantly. I like the concept of _AsyncValidatedMixin, but what's happening here is that UsernameEditor has inherited from 3 classes, the first of which is in urwid, and when the constructor / super().__init__() status changed in urwid, _AsyncValidatedMixin.__init__() stopped being called. OK cool, so maybe we'll just manually run initializers in the case where it matters. That's semi-better, but with old urwid we end up calling _AsyncValidatedMixin.__init__() twice (once directly, once by the urwid __init__ using super()). Further workarounds could be employed but at the moment there is one user of _AsyncValidatedMixin, so just merge it into UsernameEditor. --- subiquity/ui/views/identity.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/subiquity/ui/views/identity.py b/subiquity/ui/views/identity.py index 87d1f017..732a18ee 100644 --- a/subiquity/ui/views/identity.py +++ b/subiquity/ui/views/identity.py @@ -53,9 +53,7 @@ class RealnameEditor(StringEditor, WantsToKnowFormField): return super().valid_char(ch) -class _AsyncValidatedMixin: - """Provides Editor widgets with async validation capabilities""" - +class UsernameEditor(StringEditor, WantsToKnowFormField): def __init__(self): self.validation_task = None self.initial = None @@ -63,6 +61,12 @@ class _AsyncValidatedMixin: self._validate_async_inner = None connect_signal(self, "change", self._reset_validation) + self.valid_char_pat = r"[-a-z0-9_]" + self.error_invalid_char = _( + "The only characters permitted in this field are a-z, 0-9, _ and -" + ) + super().__init__() + def set_initial_state(self, initial): self.initial = initial self.validation_result = initial @@ -86,15 +90,6 @@ class _AsyncValidatedMixin: self.validation_result = await self._validate_async_inner(value) self.bff.validate() - -class UsernameEditor(StringEditor, _AsyncValidatedMixin, WantsToKnowFormField): - def __init__(self): - self.valid_char_pat = r"[-a-z0-9_]" - self.error_invalid_char = _( - "The only characters permitted in this field are a-z, 0-9, _ and -" - ) - super().__init__() - def valid_char(self, ch): if len(ch) == 1 and not re.match(self.valid_char_pat, ch): self.bff.in_error = True