OHAI-428: add root_group plugin #124

Merged
merged 1 commit into from Jun 18, 2013

2 participants

@josephholsten

No description provided.

@btm btm commented on an outdated diff Jun 17, 2013
lib/ohai/plugins/root_group.rb
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+provides 'root_group'
+
+case ::RbConfig::CONFIG['host_os']
+when /mswin|mingw32|windows/
+ group = WMI::Win32_Group.find(:first, :conditions => {:SID => 'S-1-5-32-544'})
@btm
Chef Software, Inc. member
btm added a line comment Jun 17, 2013

We should explain in a comment what permanent SID this is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@btm btm commented on an outdated diff Jun 17, 2013
spec/ohai/plugins/root_group_spec.rb
+
+ describe 'with wheel group' do
+ before(:each) do
+ @grgid.stub!(:name).and_return('wheel')
+ end
+ it 'should have a root_group of wheel' do
+ @ohai._require_plugin('root_group')
+ @ohai[:root_group].should == 'wheel'
+ end
+ end
+
+ describe 'with root group' do
+ before(:each) do
+ @grgid.stub!(:name).and_return('root')
+ end
+ it 'should have a root_group of wheel' do
@btm
Chef Software, Inc. member
btm added a line comment Jun 17, 2013

test description refers to wheel here, the test checks for root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@btm btm merged commit 342609d into chef:master Jun 18, 2013
@btm
Chef Software, Inc. member

Merged to master.

@josephholsten josephholsten deleted the josephholsten:OHAI-428 branch Jun 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment