Use io.BytesIO instead of sqlalchemy.byte_buffer

application_package uses byte_buffer to write an in-memory
zipfile. byte_buffer wasn't introduced into sqlalchemy until
v0.9 as part of the python3k compat changes. Patch changes
application_package to use io.BytesIO instead.

Alternative is to change the sqlalchemy and -migrate package
versions.

Change-Id: I59f23d2ed4e37063dca4d2a70e9f6184bd0e0aeb
Closes-Bug: 1309743
This commit is contained in:
Steve McLellan 2014-04-18 15:59:37 -05:00
parent bd7a820fd0
commit 68441ce095
1 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,7 @@
# limitations under the License.
import imghdr
import io
import os
import shutil
import sys
@ -21,7 +22,6 @@ import tempfile
import yaml
import zipfile
from sqlalchemy.util import byte_buffer
import muranoapi.packages.exceptions as e
import muranoapi.packages.versions.v1
@ -227,7 +227,7 @@ def _zipdir(path, zipf):
def _pack_dir(source_directory):
blob = byte_buffer()
blob = io.BytesIO()
zipf = zipfile.ZipFile(blob, mode='w')
_zipdir(source_directory, zipf)
zipf.close()