Fix some bugs on windows

This commit is contained in:
Julien Duponchelle committed 2016-09-27 17:05:03 +02:00
1 parent 3a8ca1071e
commit be5d543f20
5 files changed
+14 -8

No files matched your search

-1
View File
@@ -472,7 +472,6 @@ def _convert_snapshots(topo_dir):
for root, dirs, files in os.walk(snapshot_dir):
for file in files:
myzip.write(os.path.join(root, file), os.path.relpath(os.path.join(root, file), snapshot_dir), compress_type=zipfile.ZIP_DEFLATED)
shutil.copy(snapshot_arc, "/tmp/test.zip")
shutil.rmtree(old_snapshots_dir)
+4 -4
View File
@@ -17,17 +17,17 @@
import re
import os
import textwrap
import posixpath
import pathlib
def force_unix_path(path):
"""
:param path: Path to convert
"""
path = path.replace("\\", "/")
return posixpath.normpath(path)
p = pathlib.Path(os.path.normpath(path))
return p.as_posix()
def macaddress_to_int(mac_address):