def test_mark_www_rings_deleted(self, mock_get_www_dir):
     try:
         tmpdir = tempfile.mkdtemp()
         mock_get_www_dir.return_value = tmpdir
         swift_utils.mark_www_rings_deleted()
     finally:
         shutil.rmtree(tmpdir)
 def test_mark_www_rings_deleted(self, mock_get_www_dir):
     try:
         tmpdir = tempfile.mkdtemp()
         mock_get_www_dir.return_value = tmpdir
         swift_utils.mark_www_rings_deleted()
     finally:
         shutil.rmtree(tmpdir)
def storage_joined():
    if not is_elected_leader(SWIFT_HA_RES):
        log("New storage relation joined - stopping proxy until ring builder "
            "synced", level=INFO)
        service_stop('swift-proxy')

        # This unit is not currently responsible for distributing rings but
        # may become so at some time in the future so we do this to avoid the
        # possibility of storage nodes getting out-of-date rings by deprecating
        # any existing ones from the www dir.
        mark_www_rings_deleted()
def storage_joined():
    if not is_elected_leader(SWIFT_HA_RES):
        log(
            "New storage relation joined - stopping proxy until ring builder "
            "synced",
            level=INFO)
        service_stop('swift-proxy')

        # This unit is not currently responsible for distributing rings but
        # may become so at some time in the future so we do this to avoid the
        # possibility of storage nodes getting out-of-date rings by deprecating
        # any existing ones from the www dir.
        mark_www_rings_deleted()
    try_initialize_swauth()
示例#5
0
def storage_joined(rid=None):
    if not is_elected_leader(SWIFT_HA_RES):
        log(
            "New storage relation joined - stopping proxy until ring builder "
            "synced",
            level=INFO)
        service_stop('swift-proxy')

        # This unit is not currently responsible for distributing rings but
        # may become so at some time in the future so we do this to avoid the
        # possibility of storage nodes getting out-of-date rings by deprecating
        # any existing ones from the www dir.
        mark_www_rings_deleted()
    try_initialize_swauth()

    # NOTE(jamespage): Ensure private-address is set to any network-space
    #                  binding provided by the charm user.
    relation_set(relation_id=rid,
                 relation_settings={
                     'private-address': get_relation_ip('swift-storage')
                 })