Use loggging everywhere.
This commit is contained in:
parent
44ef61d544
commit
fa76abbb32
@ -59,6 +59,7 @@ class Main(object):
|
|||||||
except(ConfigurationError):
|
except(ConfigurationError):
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
self.set_logging()
|
self.set_logging()
|
||||||
#beurk
|
#beurk
|
||||||
swsync.utils.CONFIG = conf
|
swsync.utils.CONFIG = conf
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
import logging
|
||||||
|
|
||||||
import swiftclient
|
import swiftclient
|
||||||
import dateutil.relativedelta
|
import dateutil.relativedelta
|
||||||
@ -62,7 +63,7 @@ class Accounts(object):
|
|||||||
full_listing=True))
|
full_listing=True))
|
||||||
|
|
||||||
for container in orig_containers:
|
for container in orig_containers:
|
||||||
print container
|
logging.info("Syncronizing %s: %s", container['name'], container)
|
||||||
dt1 = datetime.datetime.fromtimestamp(time.time())
|
dt1 = datetime.datetime.fromtimestamp(time.time())
|
||||||
self.container_cls.sync(orig_storage_cnx,
|
self.container_cls.sync(orig_storage_cnx,
|
||||||
orig_storage_url,
|
orig_storage_url,
|
||||||
@ -74,10 +75,10 @@ class Accounts(object):
|
|||||||
dt2 = datetime.datetime.fromtimestamp(time.time())
|
dt2 = datetime.datetime.fromtimestamp(time.time())
|
||||||
rd = dateutil.relativedelta.relativedelta(dt2, dt1)
|
rd = dateutil.relativedelta.relativedelta(dt2, dt1)
|
||||||
#TODO(chmou): use logging
|
#TODO(chmou): use logging
|
||||||
print "%d hours, %d minutes and %d seconds" % (rd.hours,
|
logging.info("%s done: %d hours, %d minutes and %d seconds",
|
||||||
rd.minutes,
|
container['name'],
|
||||||
rd.seconds)
|
rd.hours,
|
||||||
print
|
rd.minutes, rd.seconds)
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
"""Process all keystone accounts to sync."""
|
"""Process all keystone accounts to sync."""
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
import logging
|
||||||
|
|
||||||
import swiftclient
|
import swiftclient
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ class Containers(object):
|
|||||||
pool = eventlet.GreenPool(size=self.max_gthreads)
|
pool = eventlet.GreenPool(size=self.max_gthreads)
|
||||||
pile = eventlet.GreenPile(pool)
|
pile = eventlet.GreenPile(pool)
|
||||||
for obj in diff:
|
for obj in diff:
|
||||||
print obj
|
logging.info("sending: %s ts:%s", obj[1], obj[0])
|
||||||
pile.spawn(self.objects_cls,
|
pile.spawn(self.objects_cls,
|
||||||
orig_storage_url,
|
orig_storage_url,
|
||||||
orig_token,
|
orig_token,
|
||||||
|
Loading…
Reference in New Issue
Block a user