コード例 #1
0
 def test_pause_unit_helper(self):
     with mock.patch.object(percona_utils, '_pause_resume_helper') as prh:
         percona_utils.pause_unit_helper('random-config')
         prh.assert_called_once_with(percona_utils.pause_unit,
                                     'random-config')
     with mock.patch.object(percona_utils, '_pause_resume_helper') as prh:
         percona_utils.resume_unit_helper('random-config')
         prh.assert_called_once_with(percona_utils.resume_unit,
                                     'random-config')
コード例 #2
0
 def test_pause_unit_helper(self):
     with mock.patch.object(percona_utils, '_pause_resume_helper') as prh:
         percona_utils.pause_unit_helper('random-config')
         prh.assert_called_once_with(percona_utils.pause_unit,
                                     'random-config')
     with mock.patch.object(percona_utils, '_pause_resume_helper') as prh:
         percona_utils.resume_unit_helper('random-config')
         prh.assert_called_once_with(percona_utils.resume_unit,
                                     'random-config')
コード例 #3
0
def prepare():
    # Use the pause feature to stop mysql during the duration of the upgrade
    pause_unit_helper(register_configs())
    # Set this unit to series upgrading
    set_unit_upgrading()
    # The leader will "bootstrap" with no wrep peers
    # Non-leaders will point only at the newly upgraded leader until the
    # cluster series upgrade is completed.
    # Set cluster_series_upgrading for the duration of the cluster series
    # upgrade. This will be unset with the action
    # complete-cluster-series-upgrade on the leader node.
    hosts = []

    if not leader_get('cluster_series_upgrade_leader'):
        leader_set(cluster_series_upgrading=True)
        leader_set(cluster_series_upgrade_leader=get_relation_ip('cluster'))
    else:
        hosts = [leader_get('cluster_series_upgrade_leader')]

    # Render config
    render_config(hosts)
コード例 #4
0
def prepare():
    # Use the pause feature to stop mysql during the duration of the upgrade
    pause_unit_helper(register_configs())
    # Set this unit to series upgrading
    set_unit_upgrading()
    # The leader will "bootstrap" with no wrep peers
    # Non-leaders will point only at the newly upgraded leader until the
    # cluster series upgrade is completed.
    # Set cluster_series_upgrading for the duration of the cluster series
    # upgrade. This will be unset with the action
    # complete-cluster-series-upgrade on the leader node.
    hosts = []

    if not leader_get('cluster_series_upgrade_leader'):
        leader_set(cluster_series_upgrading=True)
        leader_set(
            cluster_series_upgrade_leader=get_relation_ip('cluster'))
    else:
        hosts = [leader_get('cluster_series_upgrade_leader')]

    # Render config
    render_config(hosts)
コード例 #5
0
def pause(args):
    """Pause the MySQL service.

    @raises Exception should the service fail to stop.
    """
    pause_unit_helper(register_configs())
コード例 #6
0
def pause(args):
    """Pause the MySQL service.

    @raises Exception should the service fail to stop.
    """
    pause_unit_helper(register_configs())