Permalink
Browse files

Error out immediatly if lpadmin command not in path

  • Loading branch information...
simoncadman committed Jan 26, 2014
1 parent 0ec1272 commit a59e9b25a7c3b332ae8e6da8fb6f29c3bf131668
Showing with 14 additions and 9 deletions.
  1. +1 −1 backend.py
  2. +1 −1 deleteaccount.py
  3. +1 −1 dynamicppd.py
  4. +1 −1 listcloudprinters.py
  5. +1 −1 listdrivefiles.py
  6. +1 −1 reportissues.py
  7. +1 −1 setupcloudprint.py
  8. +1 −1 submitjob.py
  9. +6 −1 upgrade.py
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
View
@@ -19,7 +19,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Printer Drive Lister Version " + CCPVersion
sys.exit(0)
View
@@ -19,7 +19,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140126 002826"
+ CCPVersion = "20140126 174301"
print "CUPS Cloud Print Submit Job Version " + CCPVersion
sys.exit(0)
View
@@ -37,7 +37,7 @@
sys.stderr.write("If you are upgrading from version 20131013 or earlier you should be aware that the scripts have moved from /usr/lib/cloudprint-cups to /usr/share/cloudprint-cups\n")
# line below is replaced on commit
-CCPVersion = "20140126 002826"
+CCPVersion = "20140126 174301"
if len(sys.argv) == 2 and sys.argv[1] == 'version':
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion
@@ -65,6 +65,11 @@
sys.stderr.write("\n\nRun: /usr/share/cloudprint-cups/setupcloudprint.py to setup your Google Credentials and add your printers to CUPS\n\n")
sys.exit(0)
+from backend import which
+if which('lpadmin') == None:
+ sys.stderr.write("lpadmin command not found, you may need to run this script as root\n")
+ sys.exit(1)
+
for device in cupsprinters:
try:
if ( cupsprinters[device]["device-uri"].find("cloudprint://") == 0 ):

0 comments on commit a59e9b2

Please sign in to comment.