[pungi-wrapper] Remove duplicated code

This is almost exact duplicate of util.makedirs. One copy should be
enough.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-31 10:07:09 +02:00
parent 490514e263
commit c5c2261489

View File

@ -15,10 +15,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import errno
import os
import re
from .. import util
PACKAGES_RE = {
"rpm": re.compile(r"^RPM(\((?P<flags>[^\)]+)\))?: (?:file://)?(?P<path>/?[^ ]+)$"),
@ -43,11 +44,7 @@ class PungiWrapper(object):
ks_path = os.path.abspath(ks_path)
ks_dir = os.path.dirname(ks_path)
try:
os.makedirs(ks_dir)
except OSError as ex:
if ex.errno != errno.EEXIST:
raise
util.makedirs(ks_dir)
kickstart = open(ks_path, "w")