raise ArgumentFormat('CephName: no . in {0}'.format(s))
else:
t, i = s.split('.')
- if not t in ('osd', 'mon', 'client', 'mds'):
+ if t not in ('osd', 'mon', 'client', 'mds'):
raise ArgumentValid('unknown type ' + t)
if t == 'osd':
if i != '*':
def valid(self, s, partial=False):
if not partial:
- if not s in self.strings:
+ if s not in self.strings:
# show as __str__ does: {s1|s2..}
raise ArgumentValid("{0} not in {1}".format(s, self))
self.val = s
desc = {'type': t, 'name': 'prefix', 'prefix': desc}
else:
# not a simple string, must be dict
- if not 'type' in desc:
+ if 'type' not in desc:
s = 'JSON descriptor {0} has no type'.format(sig)
raise JsonFormat(s)
# look up type string in our globals() dict; if it's an
raise e
sigdict = {}
for cmdtag, cmd in overall.iteritems():
- if not 'sig' in cmd:
+ if 'sig' not in cmd:
s = "JSON descriptor {0} has no 'sig'".format(cmdtag)
raise JsonFormat(s)
# check 'avail' and possibly ignore this command
if 'avail' in cmd:
- if not consumer in cmd['avail']:
+ if consumer not in cmd['avail']:
continue
# rewrite the 'sig' item with the argdesc-ized version, and...
cmd['sig'] = parse_funcsig(cmd['sig'])
prefix = ' '.join(rel_ep.split('/')).strip()
# show "match as much as you gave me" help for unknown endpoints
- if not ep in app.ceph_urls:
+ if ep not in app.ceph_urls:
helptext = show_human_help(prefix)
if helptext:
resp = flask.make_response(helptext, 400)