Пример #1
0
    def update_host(self, current_host, new_host, force=False):
        """Modify the host name associated with a share and share server.

           Particularly to recover from cases where one has moved
           their Manila Share node, or modified their 'host' opt
           or their backend section name in the manila configuration file.
        """
        if not force:
            self._validate_hosts(current_host, new_host)
        ctxt = context.get_admin_context()
        updated = db.share_instances_host_update(ctxt, current_host, new_host)
        print("Updated host of %(count)s share instances on %(chost)s "
              "to %(nhost)s." % {
                  'count': updated,
                  'chost': current_host,
                  'nhost': new_host
              })

        servers = db.share_servers_host_update(ctxt, current_host, new_host)
        print("Updated host of %(count)s share servers on %(chost)s "
              "to %(nhost)s." % {
                  'count': servers,
                  'chost': current_host,
                  'nhost': new_host
              })
Пример #2
0
    def update_host(self, current_host, new_host, force=False):
        """Modify the host name associated with a share.

           Particularly to recover from cases where one has moved
           their Manila Share node, or modified their 'host' opt
           or their backend section name in the manila configuration file.
        """
        if not force:
            self._validate_hosts(current_host, new_host)
        ctxt = context.get_admin_context()
        updated = db.share_instances_host_update(ctxt, current_host, new_host)
        print("Updated host of %(count)s share instances on %(chost)s "
              "to %(nhost)s." % {'count': updated, 'chost': current_host,
                                 'nhost': new_host})