Home | History | Annotate | Download | only in site_utils

Lines Matching refs:Server

5 """This module provides utility functions to help managing servers in server
8 After a role is added or removed from a server, certain services may need to
10 added to a primary server. This module includes functions to check if actions
19 from autotest_lib.frontend.server import models as server_models
24 # Actions that must be executed for server management action to be effective.
45 # is added to the server, or the server's status is changed to primary.
59 # Action should be taken before role is deleted from a server, or the server's
68 # Action should be taken after role is deleted from a server, or the server's
79 It usually involves ssh to the server with specific role and run the
80 command, e.g., ssh to scheduler server and restart scheduler.
93 role=role, status=server_models.Server.STATUS.PRIMARY)
96 'server with given role %s was found.' %
100 for server in servers:
101 print 'Run command `%s` on server %s' % (command, server.hostname)
103 infra.execute_command(server.hostname, command)
105 print >> sys.stderr, ('Failed to check server %s, error: %s' %
106 (server.hostname, e))
109 def try_execute(server, roles, enable, post_change,
110 prev_status=server_models.Server.STATUS.BACKUP,
112 """Try to execute actions for given role changes of the server.
114 @param server: Server that has the role changes.
116 @param enable: Set to True if the roles are enabled, i.e., added to server.
117 If it's False, the roles are removed from the server.
122 since actions should be applied if the server's status
129 # This check is to prevent actions to be applied to server not in primary
130 # role or server database is not enabled. Note that no action is needed
131 # before a server is changed to primary status. If that assumption is
133 if (server.status != server_models.Server.STATUS.PRIMARY and
134 prev_status != server_models.Server.STATUS.PRIMARY):