parse_size#

Run commands and agent-written programs inside an operating-system boundary. See the guide.

zett_agent.sandbox.session.parse_size(value, name='size')[source]#

Turn "512MB", "1.5G" or a byte count into bytes.

K, M, G and T (with or without B or iB, in any case) are powers of 1024, which is how memory is counted everywhere else in this package. A bare number is bytes.

Raises:

SandboxPolicyError – If the value is not a size.

Parameters:
  • value (int | str)

  • name (str)

Return type:

int