Skip to content

Commit

Permalink
force cdn purge and use print_function
Browse files Browse the repository at this point in the history
  • Loading branch information
crbates committed Dec 19, 2014
1 parent 47eb5ff commit 49db956
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* The new prebuilt_nuc_data.h5 should now be on rackspace it may take 12-24 hours for this to propagate to all the CDN nodes.
"""
from __future__ import print_function
import pyrax
import os

Expand All @@ -29,13 +30,15 @@ def push_rackspace(fname, cred_file='rs.cred'):
cf = pyrax.cloudfiles
with open(fname, 'rb') as f:
fdata = f.read()
cont = cf.get_container("pyne-data")
cont.purge_cdn_object('prebuilt_nuc_data.h5')
obj = cf.store_object("pyne-data", fname, fdata)


pyrax.set_setting("identity_type", "rackspace")
pyrax.set_setting('region', 'ORD')
pyrax.set_credential_file('rs.cred')
cf = pyrax.cloudfiles
print "list_containers:", cf.list_containers()
print "get_all_containers:", cf.get_all_containers()
print("list_containers: {}".format(cf.list_containers()))
print("get_all_containers: {}".format(cf.get_all_containers()))
push_rackspace('prebuilt_nuc_data.h5')

0 comments on commit 49db956

Please sign in to comment.