ret, outbuf, outs = cluster.mon_command(cmd, inbuf, timeout)
else:
ret, outbuf, outs = cluster.mon_command(cmd, inbuf, timeout, target[1])
+ elif target[0] == 'mds':
+ mds_spec = target[1]
+
+ if verbose:
+ print >> sys.stderr, 'submit {0} to mds.{1}'.\
+ format(cmd, mds_spec)
+
+ try:
+ from cephfs import LibCephFS
+ except ImportError:
+ raise RuntimeError("CephFS unavailable, have you installed libcephfs?")
+
+ filesystem = LibCephFS(cluster.conf_defaults, cluster.conffile)
+ filesystem.conf_parse_argv(cluster.parsed_args)
+
+ filesystem.init()
+ ret, outbuf, outs = \
+ filesystem.mds_command(mds_spec, cmd, inbuf)
+ filesystem.shutdown()
else:
raise ArgumentValid("Bad target type '{0}'".format(target[0]))
except Exception as e:
if not isinstance(e, ArgumentError):
- raise RuntimeError('"{0}": exception {1}'.format(cmd, e))
+ raise RuntimeError('"{0}": exception {1}'.format(argdict, e))
else:
raise