Permalink
Browse files

Use lp group instead of trying to discover group name dynamically

  • Loading branch information...
simoncadman committed May 10, 2013
1 parent c57d906 commit 72e833c9c9829229930c380907e8e178a7102ad8
Showing with 5 additions and 5 deletions.
  1. +5 −5 auth.py
View
10 auth.py
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import json, os, grp, sys
+import json, os, grp, sys, grp
from oauth2client import client
from oauth2client import multistore_file
from cloudprintrequestor import cloudprintrequestor
@@ -69,8 +69,8 @@ def AddAccount(storage, userid=None): # pragma: no cover
print("")
credentials = flow.step2_exchange(code)
storage.put(credentials)
- filedetails = os.stat(__file__)
- lpid = filedetails.st_gid
+ lpgrp = grp.getgrnam('lp')
+ lpid = lpgrp.gr_gid
# fix permissions
try:
@@ -94,8 +94,8 @@ def SetupAuth(interactive=False):
requestor, storage: Authenticated requestors and an instance of storage
"""
modifiedconfig = False
- filedetails = os.stat(__file__)
- lpid = filedetails.st_gid
+ lpgrp = grp.getgrnam('lp')
+ lpid = lpgrp.gr_gid
# parse config file and extract useragents, which we use for account names
userids = []

0 comments on commit 72e833c

Please sign in to comment.