本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.set_data_path方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.set_data_path方法的具体用法?Python RestConnection.set_data_path怎么用?Python RestConnection.set_data_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.set_data_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import set_data_path [as 别名]
command = "rm -rf /usr/disk-img; mkdir -p /usr/disk-img"
output, _ = shell.execute_command(command)
if len(output) > 0:
raise Exception("Unable to create directory /usr/disk-img on " + server.ip)
print "creating disk file /usr/disk-img/disk-cbqe3043.ext3 on " + server.ip
command = "dd if=/dev/zero of=/usr/disk-img/disk-cbqe3043.ext3 count=40960"
output, _ = shell.execute_command(command)
if len(output) > 0:
raise Exception("Unable to create disk file /usr/disk-img/disk-cbqe3043.ext3 on " + server.ip)
print "formatting disk file into an ext3 filesystem on " + server.ip
command = "/sbin/mkfs -t ext3 -q /usr/disk-img/disk-cbqe3043.ext3 -F"
output, _ = shell.execute_command(command)
if len(output) > 0:
raise Exception("Unable to format disk file into an ext3 filesystem on " + server.ip)
print "mounting /cbqe3043 on" + server.ip
command = "mount -o loop,rw,usrquota,grpquota /usr/disk-img/disk-cbqe3043.ext3 /cbqe3043"
output, _ = shell.execute_command(command)
if len(output) > 0:
raise Exception("Unable to mount /cbqe3043 on " + server.ip)
print "giving 777 permissions for /cbqe3043 on " + server.ip
command = "chmod 777 /cbqe3043"
output, _ = shell.execute_command(command)
if len(output) > 0:
raise Exception("Unable to give permissions for /cbqe3043 on " + server.ip)
print "setting data path to /cbqe3043 on " + server.ip
rest_conn = RestConnection(server)
rest_conn.set_data_path(data_path="/cbqe3043")
if __name__ == "__main__":
main()