Move package to swsync.

This commit is contained in:
Chmouel Boudjnah 2013-03-27 17:52:53 +01:00
parent d58701bbc1
commit f85bbfaee4
15 changed files with 16 additions and 20 deletions

View File

@ -11,9 +11,9 @@ from keystoneclient.v2_0 import client as ksclient
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from common.utils import get_config
from sync.filler import (load_index, load_containers_index,
create_swift_account, fill_swift,
delete_account_content, delete_account)
from swsync.filler import (load_index, load_containers_index,
create_swift_account, fill_swift,
delete_account_content, delete_account)
def main():

View File

@ -4,8 +4,8 @@ import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import sync.accounts
import swsync.accounts
if __name__ == '__main__':
sync.accounts.main()
swsync.accounts.main()

View File

@ -18,7 +18,7 @@
import setuptools
from sync.openstack.common import setup
from swsync.openstack.common import setup
name = 'swsync'

View File

@ -22,14 +22,14 @@ import dateutil.relativedelta
import keystoneclient.v2_0.client
from utils import get_config
import containers
import swsync.containers
class Accounts(object):
"""Process Keystone Accounts."""
def __init__(self):
self.keystone_cnx = None
self.container_cls = containers.Containers()
self.container_cls = swsync.containers.Containers()
def get_swift_auth(self, auth_url, tenant, user, password):
"""Get swift connexion from args"""

View File

@ -17,8 +17,8 @@
import swiftclient
import eventlet
from objects import sync_object
from utils import get_config
from swsync.objects import sync_object
from swsync.utils import get_config
class Containers(object):

View File

@ -25,8 +25,6 @@
# Read pickled index file (index_path) to process a deletion
# of objects/containers store in swift for each account then delete
# accounts.
import os
import sys

View File

@ -2,7 +2,6 @@
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
import os
import ConfigParser
import swiftclient.client as swclient
CONFIG = {}

View File

@ -18,7 +18,7 @@ import swiftclient
import keystoneclient
import base as test_base
import sync.accounts
import swsync.accounts
from fakes import FakeSWConnection, TENANTS_LIST, STORAGE_ORIG, \
STORAGE_DEST, FakeSWClient, FakeKS, CONFIGDICT, CONTAINERS_LIST, \
fake_get_config
@ -27,13 +27,13 @@ from fakes import FakeSWConnection, TENANTS_LIST, STORAGE_ORIG, \
class TestAccount(test_base.TestCase):
def setUp(self):
super(TestAccount, self).setUp()
self.accounts_cls = sync.accounts.Accounts()
self.accounts_cls = swsync.accounts.Accounts()
self._stubs()
def _stubs(self):
self.stubs.Set(keystoneclient.v2_0, 'client', FakeKS)
self.stubs.Set(swiftclient.client, 'Connection', FakeSWConnection)
self.stubs.Set(sync.accounts, 'get_config', fake_get_config)
self.stubs.Set(swsync.accounts, 'get_config', fake_get_config)
self.stubs.Set(swiftclient, 'get_account', FakeSWClient.get_account)
self.stubs.Set(swiftclient, 'http_connection',
FakeSWClient.http_connection)

View File

@ -18,8 +18,7 @@ import urlparse
import swiftclient
import sync.containers
import sync.objects
import swsync.containers
import base as test_base
from fakes import STORAGE_ORIG, STORAGE_DEST, TENANTS_LIST, \
@ -29,7 +28,7 @@ from fakes import STORAGE_ORIG, STORAGE_DEST, TENANTS_LIST, \
class TestContainers(test_base.TestCase):
def setUp(self):
super(TestContainers, self).setUp()
self.container_cls = sync.containers.Containers()
self.container_cls = swsync.containers.Containers()
self.tenant_name = 'foo1'
self.tenant_id = TENANTS_LIST[self.tenant_name]['id']

View File

@ -13,7 +13,7 @@ commands = python setup.py testr --testr-args="{posargs}"
[testenv:pep8]
deps = pep8
commands = pep8 --repeat --show-source sync bin setup.py tests
commands = pep8 --repeat --show-source swsync bin setup.py tests
[testenv:venv]
commands = {posargs}