diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-06-03 19:25:03 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-06-03 19:25:03 -0500 |
commit | 943e79a7e8a9014fd9a7557d4697417257cbd5e5 (patch) | |
tree | be1e8051ca715fd1aa5cac91aa38048c1f7d3be3 | |
parent | ae228b7b879389da753851855e05a405aac520f4 (diff) | |
download | horizon-943e79a7e8a9014fd9a7557d4697417257cbd5e5.tar.gz horizon-943e79a7e8a9014fd9a7557d4697417257cbd5e5.tar.bz2 horizon-943e79a7e8a9014fd9a7557d4697417257cbd5e5.tar.xz horizon-943e79a7e8a9014fd9a7557d4697417257cbd5e5.zip |
json: Support models without a root mount defined
-rw-r--r-- | tools/hscript-fromjson/jsonconv.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/hscript-fromjson/jsonconv.cc b/tools/hscript-fromjson/jsonconv.cc index b5c9504..cbe6a60 100644 --- a/tools/hscript-fromjson/jsonconv.cc +++ b/tools/hscript-fromjson/jsonconv.cc @@ -43,11 +43,11 @@ bool parse_one_desc(json desc, std::ostream &out) { ENSURE_KEY(desc, "hostname"); ENSURE_KEY(desc, "rootpw"); ENSURE_KEY(desc, "packages"); - ENSURE_KEY(desc, "root"); + //ENSURE_KEY(desc, "root"); out << "hostname " << desc["hostname"].get<std::string>() << std::endl; out << "rootpw " << desc["rootpw"].get<std::string>() << std::endl; - out << "mount " << desc["root"].get<std::string>() << " /" << std::endl; + if(desc.find("root") != desc.end()) out << "mount " << desc["root"].get<std::string>() << " /" << std::endl; if(desc.find("netaddresses") != desc.end()) { out << "network true" << std::endl; |