All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

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
#!/usr/local/bin/python
#
# Copyright (c) 2005-2016 University of Utah and the Flux Group.
# Copyright (c) 2005-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -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")
pass
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"
pass
pass
pass
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment