Class: Vagrant::Smartos::Zones::Util::ZoneGroup
- Inherits:
-
Object
- Object
- Vagrant::Smartos::Zones::Util::ZoneGroup
- Includes:
- GlobalZone::Helper
- Defined in:
- lib/vagrant/smartos/zones/util/zone_group.rb
Instance Attribute Summary collapse
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
Instance Method Summary collapse
- #create(group) ⇒ Object
- #find(group) ⇒ Object
-
#initialize(machine, zone) ⇒ ZoneGroup
constructor
A new instance of ZoneGroup.
Methods included from GlobalZone::Helper
Constructor Details
#initialize(machine, zone) ⇒ ZoneGroup
Returns a new instance of ZoneGroup.
13 14 15 16 |
# File 'lib/vagrant/smartos/zones/util/zone_group.rb', line 13 def initialize(machine, zone) @machine = machine @zone = zone end |
Instance Attribute Details
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
11 12 13 |
# File 'lib/vagrant/smartos/zones/util/zone_group.rb', line 11 def machine @machine end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone.
11 12 13 |
# File 'lib/vagrant/smartos/zones/util/zone_group.rb', line 11 def zone @zone end |
Instance Method Details
#create(group) ⇒ Object
27 28 29 |
# File 'lib/vagrant/smartos/zones/util/zone_group.rb', line 27 def create(group) zone.zlogin("groupadd #{group}") end |
#find(group) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/vagrant/smartos/zones/util/zone_group.rb', line 18 def find(group) Models::ZoneGroup.new.tap do |g| g.name = group with_gz("#{sudo} zlogin #{zone.uuid} gid -g #{group}") do |_type, output| g.gid = output.chomp end end end |