Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Call to "get cmdb" on Darwin outside of a task throws bash error

Aperta
#1,367 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@stantheman0128 ci sta già lavorando.

Dal 23/9/2026.

  • #1368 di @sdondley — aperta
  • #1660 di @stantheman0128 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
perl

Direzione di ricerca

Riproduci il problema con il Rexfile fornito su Darwin, quindi leggi lib/Rex/Hardware/Memory.pm intorno alla riga 193 e lib/Rex/Hardware/Swap.pm intorno alla riga 143. Confronta il comportamento di get cmdb() al di fuori e all’interno di un task. Il lavoro è completato quando la chiamata al di fuori di un task termina senza emettere l’errore ripetuto free: command not found.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Following bash message is shown twice on STDERR:

sh: free: command not found

How to reproduce it

Steps to reproduce the behavior:

  1. Add the following code in the main body of a Rexfile outside of a task:

get cmdb()

Shortest code example that demonstrates the bug:

use Rex -feature => [ qw( 1.4 ) ];
get cmdb();

task test => sub {
};

1;

Expected behavior

No error.

Circumstances

  • Rex version: 11
  • Perl version: 5.24.4
  • OS running rex: Darwin (Catalina, 10.15.5)
  • OS managed by rex: Darwin

Other

The error can be hacked around by change commenting out this line in Rex/Hardware/Memory:
https://github.com/RexOps/Rex/blob/master/lib/Rex/Hardware/Memory.pm#L193
and replace with:
$free_str = '';

The same hack needs to be done to the line at: https://github.com/RexOps/Rex/blob/master/lib/Rex/Hardware/Swap.pm#L143

Obviously these are not proper fixes and are provided here to help pinpoint the problem.

Finally, the bug does not occur when get cmdb() is called from inside a task.

Lingua principale
Perl
Stelle
736
Fork
217
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RexOps/Rex

Tutte le issue di RexOps/Rex

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.