[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:
parent
490514e263
commit
c5c2261489
@ -15,10 +15,11 @@
|
|||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
import errno
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from .. import util
|
||||||
|
|
||||||
|
|
||||||
PACKAGES_RE = {
|
PACKAGES_RE = {
|
||||||
"rpm": re.compile(r"^RPM(\((?P<flags>[^\)]+)\))?: (?:file://)?(?P<path>/?[^ ]+)$"),
|
"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_path = os.path.abspath(ks_path)
|
||||||
|
|
||||||
ks_dir = os.path.dirname(ks_path)
|
ks_dir = os.path.dirname(ks_path)
|
||||||
try:
|
util.makedirs(ks_dir)
|
||||||
os.makedirs(ks_dir)
|
|
||||||
except OSError as ex:
|
|
||||||
if ex.errno != errno.EEXIST:
|
|
||||||
raise
|
|
||||||
|
|
||||||
kickstart = open(ks_path, "w")
|
kickstart = open(ks_path, "w")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user