diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-17 00:52:38 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-17 00:52:38 -0500 |
commit | bbe669b761db4cb03fca2dbf9a7890d5a7e120af (patch) | |
tree | 580b71e39783a72c0416b65ef6714f454696e221 /hscript/script_i.hh | |
parent | 28c81a32aa59a9b2d39ddd7f86fb1d2677da32cc (diff) | |
download | horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.gz horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.bz2 horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.xz horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.zip |
hscript: Add new netconfigtype key and associated tests
Not wired up to netaddress et al, but does parse properly.
Diffstat (limited to 'hscript/script_i.hh')
-rw-r--r-- | hscript/script_i.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/hscript/script_i.hh b/hscript/script_i.hh index 0ed362e..a94a0d7 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -43,6 +43,8 @@ struct Script::ScriptPrivate { /*! Determines whether or not to enable networking. */ std::unique_ptr<Network> network; + /*! Determines the network configuration system to use. */ + std::unique_ptr<NetConfigType> netconfig; /*! The target system's hostname. */ std::unique_ptr<Hostname> hostname; /*! The packages to install to the target system. */ @@ -126,6 +128,17 @@ struct Script::ScriptPrivate { return true; } + bool store_netconfig(Key *obj, int line, int *errors, int *, ScriptOptions) { + if(netconfig) { + DUPLICATE_ERROR(netconfig, "netconfigtype", + netconfig->type()); + return false; + } + std::unique_ptr<NetConfigType> nc(dynamic_cast<NetConfigType *>(obj)); + netconfig = std::move(nc); + return true; + } + bool store_hostname(Key* obj, int line, int *errors, int *, ScriptOptions) { if(hostname) { DUPLICATE_ERROR(hostname, "hostname", hostname->value()) |