salt-api-cli 1.4.2__tar.gz → 1.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: salt-api-cli
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: CLI to access salt-api
5
5
  Author-email: Pradish Bijukchhe <pradish@sandbox.com.np>
6
6
  License-Expression: MIT
@@ -177,8 +177,23 @@ def _print_state_return(minion: str, states: dict[str, Any]) -> None:
177
177
  if status == "ok":
178
178
  detail: str | Text = ""
179
179
  elif status == "change":
180
- changed = ", ".join(state.get("changes", {})) or "(changes)"
181
- detail = f"changed: {_short(changed)}"
180
+ changes = state.get("changes", {})
181
+ if "stdout" in changes:
182
+ # cmd.run-style changes: show the command's output itself
183
+ # rather than the fixed pid/retcode/stdout/stderr key list.
184
+ out = (
185
+ str(changes.get("stdout") or "").strip()
186
+ or str(changes.get("stderr") or "").strip()
187
+ )
188
+ # Full output, folded across lines, so nothing is cut off.
189
+ detail = (
190
+ Text(out, no_wrap=False, overflow="fold")
191
+ if out
192
+ else "changed: (no output)"
193
+ )
194
+ else:
195
+ changed = ", ".join(changes) or "(changes)"
196
+ detail = f"changed: {_short(changed)}"
182
197
  elif status == "fail":
183
198
  detail = Text(_short(state.get("comment", ""), 240), style="red")
184
199
  else: # diff / skip
@@ -193,7 +208,12 @@ def _print_state_return(minion: str, states: dict[str, Any]) -> None:
193
208
  fn_w = max((len(fn) for _, fn, _, _ in rows), default=8)
194
209
  ref_w = max((len(ref) for _, _, ref, _ in rows), default=8)
195
210
  nat_w = max(
196
- (len(d.plain if isinstance(d, Text) else d) for _, _, _, d in rows), default=0
211
+ (
212
+ len(line)
213
+ for _, _, _, d in rows
214
+ for line in (d.plain if isinstance(d, Text) else d).splitlines()
215
+ ),
216
+ default=0,
197
217
  )
198
218
  detail_w = min(nat_w, max(20, console.width - 2 - 1 - fn_w - ref_w - 3 * 2))
199
219
 
@@ -242,7 +262,7 @@ def _print_state_result(result: dict[str, Any]) -> None:
242
262
  if not ret:
243
263
  console.print("(no minions responded)")
244
264
  return
245
- for minion in sorted(ret):
265
+ for minion in sorted(ret, key=_natural_key):
246
266
  _print_one_minion(minion, ret[minion])
247
267
 
248
268
 
@@ -0,0 +1 @@
1
+ __version__ = "1.4.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: salt-api-cli
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: CLI to access salt-api
5
5
  Author-email: Pradish Bijukchhe <pradish@sandbox.com.np>
6
6
  License-Expression: MIT
@@ -1 +0,0 @@
1
- __version__ = "1.4.2"
File without changes
File without changes
File without changes