'Modify the host name associated with a volume.
Particularly to recover from cases where one has moved
their Cinder Volume node, or modified their backend_name in a
multi-backend config.'

@args('--currenthost', required=True, help='Existing    volume    host    name')
@args('--newhost', required=True, help='New    volume    host    name')
def update_host(self, currenthost, newhost):

    ctxt = context.get_admin_context()
    volumes = db.volume_get_all_by_host(ctxt, currenthost)
    for v in volumes:
        db.volume_update(ctxt, v['id'], {'host': newhost})
