本文整理汇总了Python中cloudmesh_client.common.todo.TODO类的典型用法代码示例。如果您正苦于以下问题:Python TODO类的具体用法?Python TODO怎么用?Python TODO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TODO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: construct_ip_dict
def construct_ip_dict(cls, ip_addr, name="kilo"):
try:
d = ConfigDict("cloudmesh.yaml")
cloud_details = d["cloudmesh"]["clouds"][name]
# Handle Openstack Specific Output
if cloud_details["cm_type"] == "openstack":
ipaddr = {}
for network in ip_addr:
index = 0
for ip in ip_addr[network]:
ipaddr[index] = {}
ipaddr[index]["network"] = network
ipaddr[index]["version"] = ip["version"]
ipaddr[index]["addr"] = ip["addr"]
index += 1
return ipaddr
# Handle EC2 Specific Output
if cloud_details["cm_type"] == "ec2":
print("ec2 ip dict yet to be implemented")
TODO.implement()
# Handle Azure Specific Output
if cloud_details["cm_type"] == "azure":
print("azure ip dict yet to be implemented")
TODO.implement()
except Exception, e:
Error.traceback(e)
示例2: delete_from_file
def delete_from_file(cls, filename):
"""
:param filename:
:return:
"""
TODO.implement()
示例3: mode
def mode(self, source):
"""
Sets the source for the information to be returned. "db" and "cloud"
:param source: the database can be queried in mode "db",
the database can be bypassed in mode "cloud"
"""
TODO.implement()
示例4: __init__
def __init__(self, cloudname, user=None, flat=True):
super(CloudProvider, self).__init__(cloudname, user=user)
try:
d = ConfigDict("cloudmesh.yaml")
cloud_details = d["cloudmesh"]["clouds"][cloudname]
if cloud_details["cm_type"] == "openstack":
provider = CloudProviderOpenstackAPI(
cloudname,
cloud_details,
flat=flat)
self.provider = provider
self.provider_class = CloudProviderOpenstackAPI
if cloud_details["cm_type"] == "ec2":
print("ec2 cloud provider yet to be implemented")
TODO.implement()
if cloud_details["cm_type"] == "azure":
print("azure cloud provider yet to be implemented")
TODO.implement()
except Exception, e:
import traceback
print(traceback.format_exc())
print(e)
示例5: add_from_file
def add_from_file(self, filename):
"""
:param filename:
:return:
"""
TODO.implement()
示例6: get_table
def get_table(self, kind):
if type(kind) == str:
if kind.lower() in ["flavor"]:
return FLAVOR
elif kind.lower() in ["default"]:
return DEFAULT
elif kind.lower() in ["var"]:
return VAR
elif kind.lower() in ["image"]:
return IMAGE
elif kind.lower() in ["vm"]:
return VM
elif kind.lower() in ["key"]:
return KEY
elif kind.lower() in ["group"]:
return GROUP
elif kind.lower() in ["reservation"]:
return RESERVATION
elif kind.lower() in ["counter"]:
return COUNTER
elif kind.lower() in ["vmusermap"]:
return VMUSERMAP
elif kind.lower() in ["batchjob"]:
return BATCHJOB
elif kind.lower() in ["secgroup"]:
return SECGROUP
elif kind.lower() in ["secgrouprule"]:
return SECGROUPRULE
else:
TODO.implement("wrong table type: `{}`".format(kind))
else:
return kind
示例7: __init__
def __init__(self, cloudname, user=None, flat=True):
super(CloudProvider, self).__init__(cloudname, user=user)
try:
d = ConfigDict("cloudmesh.yaml")
if not cloudname in d["cloudmesh"]["clouds"]:
raise ValueError("the cloud {} is not defined in the yaml file"
.format(cloudname))
cloud_details = d["cloudmesh"]["clouds"][cloudname]
if cloud_details["cm_type"] == "openstack":
provider = CloudProviderOpenstackAPI(
cloudname,
cloud_details,
flat=flat)
self.provider = provider
self.provider_class = CloudProviderOpenstackAPI
if cloud_details["cm_type"] == "ec2":
print("ec2 cloud provider yet to be implemented")
TODO.implement()
if cloud_details["cm_type"] == "azure":
print("azure cloud provider yet to be implemented")
TODO.implement()
except Exception, e:
Error.traceback(e)
示例8: check
def check(cls, filename):
"""
checks the filename if it is syntactically correct and does not include tabs
:param filename:
:type filename: string
:return:
"""
TODO.implement()
示例9: info
def info(self, user=None, project=None):
"""
prints if the user has access to the reservation an on which host.
:param user:
:param project:
:return:
"""
TODO.implement()
示例10: construct_ip_dict
def construct_ip_dict(cls, ip_addr, name=None):
# TODO kilo cloud as defualt should be avoided
if name is None:
Console.error("cloud name not set")
return None
try:
d = ConfigDict("cloudmesh.yaml")
cloud_details = d["cloudmesh"]["clouds"][name]
# Handle Openstack Specific Output
if cloud_details["cm_type"] == "openstack":
ipaddr = {}
for network in ip_addr:
index = 0
for ip in ip_addr[network]:
ipaddr[index] = {}
ipaddr[index]["network"] = network
ipaddr[index]["version"] = ip["version"]
ipaddr[index]["addr"] = ip["addr"]
index += 1
return ipaddr
# Handle EC2 Specific Output
if cloud_details["cm_type"] == "ec2":
Console.TODO("ec2 ip dict yet to be implemented")
TODO.implement()
# Handle Azure Specific Output
if cloud_details["cm_type"] == "azure":
index = 0
ipaddr = {}
for ip in ip_addr:
ipaddr[index] = {}
ipaddr[index]["network"] = ip
ipaddr[index]["version"] = 'ipv4'
ipaddr[index]["addr"] = ip
index += 1
return ipaddr
except Exception as e:
Error.error("error in vm construct dict", traceback=True)
示例11: _print_dict
def _print_dict(d, header=None, format='table'):
if format == "json":
return json.dumps(d, indent=4)
elif format == "yaml":
return pyaml.dump(d)
elif format == "table":
return dict_printer(d,
order=["id",
"name",
"start_time",
"end_time",
"user",
"project",
"hosts",
"description",
"cloud"],
output="table",
sort_keys=True)
elif format == "csv":
TODO.implement()
else:
return d
示例12: resume
def resume(cls, names=None):
TODO.implement()
示例13: suspend
def suspend(cls, names=None):
TODO.implement()
示例14: do_reservation
def do_reservation(self, args, arguments):
"""
::
Usage:
reservation info --user=USER --project=PROJECT
reservation list [--name=NAME]
[--user=USER]
[--project=PROJECT]
[--hosts=HOSTS]
[--start=TIME_START]
[--end=TIME_END]
[--format=FORMAT]
reservation delete [all]
[--user=USER]
[--project=PROJECT]
[--name=NAME]
[--start=TIME_START]
[--end=TIME_END]
[--hosts=HOSTS]
reservation delete --file=FILE
reservation update --name=NAME
[--start=TIME_START]
[--end=TIME_END]
[--user=USER]
[--project=PROJECT]
[--hosts=HOSTS]
[--description=DESCRIPTION]
reservation add --name=NAME
[--start=TIME_START]
[--end=TIME_END]
[--user=USER]
[--project=PROJECT]
[--hosts=HOSTS]
[--description=DESCRIPTION]
reservation add --file=FILE
Arguments:
NAME Name of the reservation
USER Registration will be done for this user
PROJECT Project to be used
HOSTS Hosts to reserve
TIME_START Start time of reservation
TIME_END End time of reservation
FORMAT Format of output
DESCRIPTION Description for reservation
FILE File that contains reservation data to be added/ deleted
Options:
--name=NAME Names of the reservation
--user=USER user name
--project=PROJECT project id
--start=TIME_START Start time of the reservation, in
MM/DD/YYYY at hh:mm aa format. (default value: 01/01/1901 at 12:00 am])
--end=TIME_END End time of the reservation, in
MM/DD/YYYY at hh:mm aa format. (default value: 12/31/2100 at 11:59 pm])
--host=HOSTS host name
--description=DESCRIPTION description summary of the reservation
--file=FILE Adding multiple reservations from one file
--format=FORMAT Format is either table, json, yaml or csv
[default: table]
Description:
reservation info
lists the resources that support reservation for
a given user or project.
"""
# print (arguments)
def _print_dict(d, header=None, format='table'):
if format == "json":
return json.dumps(d, indent=4)
elif format == "yaml":
return pyaml.dump(d)
elif format == "table":
return dict_printer(d,
order=["id",
"name",
"start_time",
"end_time",
"user",
"project",
"hosts",
"description",
"cloud"],
output="table",
sort_keys=True)
elif format == "csv":
TODO.implement()
else:
return d
# return dict_printer(d,order=['cm_id, name, fingerprint'])
def _get_db_date_format(date):
"""
Utility Function that accepts instance of Date object and returns a string with Datetime for DB.
:param date: Date object
#.........这里部分代码省略.........
示例15: clear
def clear(self, names=None):
TODO.implement()