Skip to content

Commit

Permalink
handle case where no profiles installed
Browse files Browse the repository at this point in the history
  • Loading branch information
keeleysam committed Nov 22, 2016
1 parent c147b0e commit 753eb03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/facter/profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

plist = Puppet::Util::Plist.read_plist_file(path)

data = plist['_computerlevel']

unless data.empty?
for item in data
if plist.key?('_computerlevel')
for item in plist['_computerlevel']
profiles[item['ProfileIdentifier']] = {
'display_name' => item['ProfileDisplayName'],
'description' => item['ProfileDescription'],
Expand Down
6 changes: 2 additions & 4 deletions lib/puppet/provider/profile_manager/macos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ def getinstalledstate

plist = Puppet::Util::Plist.read_plist_file(path)

data = plist['_computerlevel']

unless data.empty?
for item in data
if plist.key?('_computerlevel')
for item in plist['_computerlevel']
if item['ProfileIdentifier'] == resource[:name]
return {
'identifier' => item['ProfileIdentifier'],
Expand Down

0 comments on commit 753eb03

Please sign in to comment.