def mon_add(args):
cfg = conf.ceph.load(args)
- if not args.mon:
- raise exc.NeedHostError()
- elif len(args.mon) > 1:
- raise exc.GenericError('Only one node can be added at a time')
+ # args.mon is a list with only one entry
mon_host = args.mon[0]
try:
)
mon_add.add_argument(
'mon',
- nargs='*',
+ nargs=1,
)
mon_create = mon_parser.add_parser(
args = self.parser.parse_args('mon add test1 --address 10.10.0.1'.split())
assert args.address == '10.10.0.1'
- @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12150")
def test_mon_add_no_host_raises_err(self):
with pytest.raises(SystemExit):
self.parser.parse_args('mon add'.split())
args = self.parser.parse_args('mon add test1'.split())
assert args.mon == ["test1"]
- @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12150")
def test_mon_add_multi_host_raises_err(self):
with pytest.raises(SystemExit):
self.parser.parse_args('mon add test1 test2'.split())