Skip to content

Commit

Permalink
fixed some bugs we found while testing Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
vallard committed Mar 7, 2018
1 parent 1f51de9 commit b4e18b1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
17 changes: 0 additions & 17 deletions kubam/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,23 +361,6 @@ def get_isos():
return jsonify({'error': isos})
return jsonify({'isos': isos}), 200

# DO NOT USE
# This API is only for extracting unknown ISOs. We can put the iso as well as the directory name we want to extract to. Use /isos/boot
# extract an ISO image. This probably isn't used as the /isos/boot does this for you as part of the
# creation process.
# curl -H "Content-Type: application/json" -X POST -d '{"iso" : "Vmware-ESXi-6.5.0-4564106-Custom-Cisco-6.5.0.2.iso", "os": "esxi6.5" }' http://localhost/api/v1/isos/extract
@app.route(API_ROOT + "/isos/extract", methods=['POST'])
@cross_origin()
def extract_iso():
if not request.json:
return jsonify({'error': 'expected iso hash'}), 400
iso = request.json['iso']
os = request.json['os']
err, msg = IsoMaker.extract_iso("/kubam/" + iso, "/kubam/" + os)
if not err == 0:
return jsonify({"error": msg}), 500
return jsonify({"status": "ok"}), 201

# make the boot ISO image of an ISO
# curl -H "Content-Type: application/json" -X POST -d '{"iso" : "Vmware-ESXi-6.5.0-4564106-Custom-Cisco-6.5.0.2.iso" }' http://localhost/api/v1/isos/boot
# curl -H "Content-Type: application/json" -X POST -d '{"iso" : "CentOS-7-x86_64-Minimal-1611.iso" }' http://localhost/api/v1/isos/boot
Expand Down
3 changes: 2 additions & 1 deletion kubam/app/autoinstall/Kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def build_boot_image(node, template):
# unmount the filesystem.
o = call(["umount", new_image_dir])
if not o == 0:
return 1, "unable to unmount %s" % new_image_dir
"" # we had a case in ubuntu where this errored and still worked.
#return 1, "unable to unmount %s" % new_image_dir
# remove mount directory
o = call(["rm", "-rf", new_image_dir])
if not o == 0:
Expand Down
4 changes: 0 additions & 4 deletions kubam/app/iso/IsoMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def mkboot_centos(os_name, version):
"/usr/share/kubam/stage1/"+os_name+version+"/isolinux.cfg",
stage_dir + "/isolinux/"])

cwd = os.getcwd()
os.chdir("/kubam")
o = 0
if os_name == "centos":
Expand All @@ -130,7 +129,6 @@ def mkboot_centos(os_name, version):

if not o == 0:
return 1, "mkisofs failed for %s" % boot_iso
os.chdir(cwd)
return 0, "success"

def mkboot_esxi(version):
Expand All @@ -143,7 +141,6 @@ def mkboot_esxi(version):
"/usr/share/kubam/stage1/esxi6.5/BOOT.CFG",
os_dir])

cwd = os.getcwd()
os.chdir("/kubam")
# https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.install.doc/GUID-C03EADEA-A192-4AB4-9B71-9256A9CB1F9C.html
o = call(["mkisofs", "-relaxed-filenames", "-J", "-R",
Expand All @@ -152,7 +149,6 @@ def mkboot_esxi(version):
"-boot-load-size" , "4",
"-boot-info-table", "-no-emul-boot", os_dir])

os.chdir(cwd)
return 0, "success"


Expand Down

0 comments on commit b4e18b1

Please sign in to comment.