Class: OsCtld::IdMap
- Inherits:
-
OsCtl::Lib::IdMap
- Object
- OsCtl::Lib::IdMap
- OsCtld::IdMap
- Defined in:
- lib/osctld/id_map.rb
Class Method Summary collapse
-
.load(cfg, old_cfg = nil) ⇒ IdMap
Load map from config file.
Instance Method Summary collapse
-
#dump ⇒ Object
Dump the map to config file.
-
#export ⇒ Object
Export the map to clients.
Class Method Details
.load(cfg, old_cfg = nil) ⇒ IdMap
Load map from config file
We’re still backward compatible with UID/GID offsets, which are converted to a map with a single entry. Remove this in the future (TODO).
11 12 13 14 15 16 17 18 |
# File 'lib/osctld/id_map.rb', line 11 def self.load(cfg, old_cfg = nil) if old_cfg && cfg.nil? && old_cfg['offset'] && old_cfg['size'] from_string_list(["0:#{old_cfg['offset']}:#{old_cfg['size']}"]) else from_string_list(cfg || []) end end |
Instance Method Details
#dump ⇒ Object
Dump the map to config file
21 22 23 |
# File 'lib/osctld/id_map.rb', line 21 def dump entries.map(&:to_s) end |
#export ⇒ Object
Export the map to clients
26 27 28 |
# File 'lib/osctld/id_map.rb', line 26 def export dump end |