sudo python /data/server/uiclient.py osd "{'ip':'10.33.80.120#10.33.80.120','task':'createosd','disk':'sda#sdb'}"
变量
uiclient_dir = /data/server/uiclient.py
ipstr = 10.33.80.120#10.33.80.120
disknamestr = sda#sdb
拼接:(这里用format会报错)
args = "sudo python %s osd " % uiclient_dir + \
"\"{'ip':'%s'," % ipstr + \
"'task':'createosd','disk':'%s'}\"" % disknamestr
网友评论