@@ -41,7 +41,7 @@ def parse(self):
41
41
parser .add_argument ('-v' , '--verbose' , action = 'store_true' , default = False )
42
42
parser .add_argument ('--force-host' , metavar = 'HOST' , help = "force this host" )
43
43
parser .add_argument ('--image-archive' , metavar = 'IMAGEARCHIVE' ,
44
- help = 'Tar archive for images' )
44
+ help = 'Archive for images' )
45
45
parser .add_argument ('magentoPath' , metavar = 'MAGENTOPATH' ,
46
46
help = 'base path of magento' )
47
47
args = parser .parse_args ()
@@ -111,7 +111,7 @@ def notFound(self):
111
111
print value
112
112
113
113
def createImageArchive (self , images ):
114
- tar = tarfile .open (self .imageArchive , 'w:gz' )
114
+ archive = tarfile .open (self .imageArchive , 'w:gz' )
115
115
counters = {}
116
116
for imagePath , productId in images .items ():
117
117
try :
@@ -123,10 +123,12 @@ def createImageArchive(self, images):
123
123
img = os .path .join (self .magentoPath , self .MEDIA_PRODUCT , imagePath [1 :])
124
124
info .size = os .path .getsize (img )
125
125
info .mtime = os .path .getmtime (img )
126
+ info .gid = 1000
127
+ info .uid = 1000
126
128
with open (img , 'r' ) as fileobj :
127
- tar .addfile (tarinfo = info , fileobj = fileobj )
128
- tar .addfile (info )
129
+ archive .addfile (tarinfo = info , fileobj = fileobj )
129
130
self .log .debug ('add %s to archive' , imagePath )
131
+ archive .close ()
130
132
self .log .info ('%s successfully created' , self .imageArchive )
131
133
132
134
def run (self ):
0 commit comments