MCPcopy Create free account
hub / github.com/ceph/ceph / count

Method count

src/pybind/mgr/hello/module.py:96–114  ·  view source on GitHub ↗

Do some counting

(self, num: int)

Source from the content-addressed store, hash-verified

94
95 @HelloCLICommand.Read('count')
96 def count(self, num: int) -> HandleCommandResult:
97 """
98 Do some counting
99 """
100 ret = 0
101 out = ''
102 err = ''
103 if num < 1:
104 err = 'That\'s too small a number&#x27;
105 ret = -errno.EINVAL
106 elif num > 10:
107 err = 'That\'s too big a number&#x27;
108 ret = -errno.EINVAL
109 else:
110 out = 'Hello, I am the count!\n'
111 out += ', '.join([str(x) for x in range(1, num + 1)]) + '!'
112 return HandleCommandResult(retval=ret,
113 stdout=out,
114 stderr=err)
115
116 def serve(self) -> None:
117 """

Callers 4

valid_addrFunction · 0.45
_pool_caps_from_uriMethod · 0.45
_list_daemonsMethod · 0.45

Calls 2

HandleCommandResultClass · 0.90
joinMethod · 0.45

Tested by

no test coverage detected