def update_inventory(name, dest_path):
if not os.path.exists(os.path.join(dest_path, '.git')):
warning("The %s inventory is not a git repository and has not "
"been updated." % name)
return
click.echo('We will update the %s inventory' % name)
os.chdir(dest_path)
try:
vgit('pull')
except ErrorReturnCode:
fatal("Unable to update the inventory %s." % name)
success("The %s inventory has been updated." % name)
评论列表
文章目录