From 08f3dce42d75f079e6a6ee79bed1e0a14fa719e9 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Wed, 21 Dec 2022 08:18:29 +1100 Subject: [PATCH 1/5] .github/workflows: use ubuntu-20.04 for python 3.6 support Signed-off-by: Tim Serong --- .github/workflows/testing.yml | 2 +- .github/workflows/tox.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c2d4858..cf40e61 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: py: diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 6943670..5dafc50 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -5,7 +5,7 @@ on: jobs: pytest: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: include: From 81d5caf8697abe915dca516aab2eb79160500c36 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 19 Dec 2022 16:42:52 +1100 Subject: [PATCH 2/5] Run `saltutil.sync_runners` in ceph-salt-formula %post script Fixes: https://github.com/ceph/ceph-salt/issues/486 Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1204438 Signed-off-by: Tim Serong --- CHANGELOG.md | 3 +++ ceph-salt.spec | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0950ef..9b06797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Run `saltutil.sync_runners` in ceph-salt-formula %post script (#486) + ## [16.2.3] - 2022-04-14 ### Fixed - Fix ceph-salt update when run prior to cluster deployment (#482) diff --git a/ceph-salt.spec b/ceph-salt.spec index bdddb84..10ed5d9 100644 --- a/ceph-salt.spec +++ b/ceph-salt.spec @@ -124,6 +124,10 @@ Requires(pre): salt-master Salt Formula to deploy Ceph clusters. +%post -n ceph-salt-formula +# This is needed in order for the network.iperf runner to work +salt-run --log-level warning saltutil.sync_runners || : + %files -n ceph-salt-formula %defattr(-,root,root,-) %license LICENSE From 45778ce50c616383e19b15a614f3a9de8cd7b948 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 19 Dec 2022 16:47:40 +1100 Subject: [PATCH 3/5] Don't explicitly install ceph-common (rely on ceph-base dependency) Since c3bf1ebf4c07b6f3ec6a2da671a3adc590c8f9f4, ceph-salt has explicitly installed both ceph-base and ceph-common. This causes installation to fail on SUSE Linux Enterprise when there's subtle discrepancies between version numbers of ceph-base and ceph-common in different software repositories. Thankfully we can fix this by simply requesting to only install ceph-base, because that already requires ceph-common anyway, so the correct version will be pulled in automatically. Fixes: https://github.com/SUSE/sesdev/issues/672 Signed-off-by: Tim Serong --- CHANGELOG.md | 1 + ceph-salt-formula/salt/ceph-salt/apply/cephtools.sls | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b06797..5e3baa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Run `saltutil.sync_runners` in ceph-salt-formula %post script (#486) +- Don't explicitly install ceph-common (rely on ceph-base dependency) ## [16.2.3] - 2022-04-14 ### Fixed diff --git a/ceph-salt-formula/salt/ceph-salt/apply/cephtools.sls b/ceph-salt-formula/salt/ceph-salt/apply/cephtools.sls index 11b9446..602237d 100644 --- a/ceph-salt-formula/salt/ceph-salt/apply/cephtools.sls +++ b/ceph-salt-formula/salt/ceph-salt/apply/cephtools.sls @@ -10,7 +10,6 @@ install cephadm: pkg.installed: - pkgs: - ceph-base - - ceph-common - failhard: True {{ macros.end_step('Install ceph packages') }} From 09dfa760ec3279e8d33289efcedc13c58850c194 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Tue, 20 Dec 2022 17:26:33 +1100 Subject: [PATCH 4/5] Support monochrome terminals in `ceph-salt apply` `ceph-salt apply` tries to use curses to display pretty colors. Unfortunately with a monochrome terminal (e.g. TERM=vt100, TERM=vt220, TERM=xterm-mono), curses.use_default_colors(), curses.init_pair() and curses.curs_set() will all return ERR in this case, curses will shut down, and the process will stall with a very non-obvious backtrace printed: Traceback (most recent call last): File "/usr/bin/ceph-salt", line 11, in load_entry_point('ceph-salt==16.2.4+1671434105.gb2e7bd5', 'console_scripts', 'ceph-salt')() File "/usr/lib/python3.6/site-packages/ceph_salt/__init__.py", line 23, in ceph_salt_main cli(prog_name='ceph-salt') File "/usr/lib/python3.6/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3.6/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python3.6/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3.6/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3.6/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/lib/python3.6/site-packages/ceph_salt/__init__.py", line 116, in apply retcode = executor.run() File "/usr/lib/python3.6/site-packages/ceph_salt/execute.py", line 1692, in run self.renderer.run() File "/usr/lib/python3.6/site-packages/ceph_salt/execute.py", line 1227, in run self.screen.shutdown() File "/usr/lib/python3.6/site-packages/ceph_salt/execute.py", line 157, in shutdown signal.signal(signal.SIGWINCH, self.previous_signal_handler) File "/usr/lib64/python3.6/signal.py", line 47, in signal handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object The actual problem ("_curses.error: use_default_colors() returned ERR") appears in /var/log/ceph-salt.log, but this isn't printed out to the terminal. If we wrap all that curses setup in an exception handler, it runs through just fine and we get a working monochrome display. Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1206528 Signed-off-by: Tim Serong --- ceph_salt/execute.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ceph_salt/execute.py b/ceph_salt/execute.py index 523f08b..350cf13 100644 --- a/ceph_salt/execute.py +++ b/ceph_salt/execute.py @@ -109,21 +109,24 @@ def start(self): self.body_height = self.height - self.HEADER_HEIGHT - self.FOOTER_HEIGHT self.body_width = self.width - 1 logger.info("current terminal size: rows=%s cols=%s", self.height, self.width) - curses.start_color() - curses.use_default_colors() - - curses.init_pair(self.COLOR_MARKER, -1, -1) - curses.init_pair(self.COLOR_MINION, curses.COLOR_CYAN, -1) - curses.init_pair(self.COLOR_STAGE, curses.COLOR_YELLOW, -1) - curses.init_pair(self.COLOR_STEP, curses.COLOR_BLUE, -1) - curses.init_pair(self.COLOR_MENU, curses.COLOR_BLACK, curses.COLOR_GREEN) - curses.init_pair(self.COLOR_SUCCESS, curses.COLOR_GREEN, -1) - curses.init_pair(self.COLOR_ERROR, curses.COLOR_RED, -1) - curses.init_pair(self.COLOR_WARNING, curses.COLOR_YELLOW, -1) + try: + curses.start_color() + curses.use_default_colors() + curses.init_pair(self.COLOR_MARKER, -1, -1) + curses.init_pair(self.COLOR_MINION, curses.COLOR_CYAN, -1) + curses.init_pair(self.COLOR_STAGE, curses.COLOR_YELLOW, -1) + curses.init_pair(self.COLOR_STEP, curses.COLOR_BLUE, -1) + curses.init_pair(self.COLOR_MENU, curses.COLOR_BLACK, curses.COLOR_GREEN) + curses.init_pair(self.COLOR_SUCCESS, curses.COLOR_GREEN, -1) + curses.init_pair(self.COLOR_ERROR, curses.COLOR_RED, -1) + curses.init_pair(self.COLOR_WARNING, curses.COLOR_YELLOW, -1) + curses.curs_set(0) + except Exception: # pylint: disable=broad-except + logger.warning("Unable to initialize curses color support (TERM=%s)", + os.environ.get('TERM', 'not set')) curses.noecho() curses.cbreak() - curses.curs_set(0) self.stdscr.keypad(True) if self.height > 2: From c6d31a85bce27b801c21d0499f6ae91220ffb3e6 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 19 Dec 2022 16:57:35 +1100 Subject: [PATCH 5/5] Bump to v16.2.4 Signed-off-by: Tim Serong --- CHANGELOG.md | 6 +++++- ceph-salt.spec | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3baa5..2c73f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [16.2.4] - 2022-12-19 ### Fixed +- Use daemon name rather than service type when stopping services - Run `saltutil.sync_runners` in ceph-salt-formula %post script (#486) - Don't explicitly install ceph-common (rely on ceph-base dependency) +- Support monochrome terminals in `ceph-salt apply` ## [16.2.3] - 2022-04-14 ### Fixed @@ -339,7 +342,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Minimal README. - The CHANGELOG file. -[Unreleased]: https://github.com/ceph/ceph-salt/compare/v16.2.3...HEAD +[Unreleased]: https://github.com/ceph/ceph-salt/compare/v16.2.4...HEAD +[16.2.4]: https://github.com/ceph/ceph-salt/releases/tag/v16.2.4 [16.2.3]: https://github.com/ceph/ceph-salt/releases/tag/v16.2.3 [16.2.2]: https://github.com/ceph/ceph-salt/releases/tag/v16.2.2 [16.2.1]: https://github.com/ceph/ceph-salt/releases/tag/v16.2.1 diff --git a/ceph-salt.spec b/ceph-salt.spec index 10ed5d9..29fcfb8 100644 --- a/ceph-salt.spec +++ b/ceph-salt.spec @@ -21,7 +21,7 @@ %endif Name: ceph-salt -Version: 16.2.3 +Version: 16.2.4 Release: 1%{?dist} Summary: CLI tool to deploy Ceph clusters License: MIT