def core_agent_permissions(self): try: return octal(self.value("core_agent_permissions")) except ValueError: logger.exception( "Invalid core_agent_permissions value, using default of 0o700") return 0o700
def core_agent_permissions(self): try: return octal(self.value("core_agent_permissions")) except ValueError as e: logger.error( "Invalid core_agent_permissions value: %s." " Using default: %s", repr(e), 0o700, ) return 0o700
def test_octal_raises_valueerror_on_invalid_value(): try: octal("THIS IS INVALID") except ValueError: pass
def test_octal_with_valid_integer(): assert 0o700 == octal(700)
def test_octal_with_valid_string(): assert 0o700 == octal("700")