def default_profile(name):
"""
Set the default flag on the named profile and clear the default
flag on all other profiles.
:param name: A server profile name
:return: None
"""
try:
ServerProfile.objects.get(name=name)
except ServerProfile.DoesNotExist:
log.error("Profile '%s' not found" % name)
sys.exit(-1)
ServerProfile.objects.update(default=False)
ServerProfile.objects.filter(name=name).update(default=True)
service_config.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录