Commit 0181b09e authored by Leigh B Stoller's avatar Leigh B Stoller

Fix minor problem with converting blockstores:

1. Size is optional, it means give me all. Note that the NS parser turns
   this into a 0 size.

2. Convert from MiB to GB which is how geni-lib wants it.
parent dfbbae0d
# Copyright (c) 2005-2016 University of Utah and the Flux Group.
# Copyright (c) 2005-2017 University of Utah and the Flux Group.
......@@ -29,6 +29,7 @@ import traceback
import string
import socket
import re
import math
import HTMLParser
# Configure stuff.
......@@ -295,7 +296,15 @@ for child in tree.getroot():
bs = node.Blockstore(vname, "/mnt")
blockstores[vname] = bs
bs.size = str(size) + "MiB"
if row.find("size") is not None:
size = int(row.find("size").text)
if size:
# Ug, Geni wants this in GB.
size = int(math.ceil(size * 0.001048576))
bs.size = str(size) + "GB"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment