public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-06-14 17:43 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-06-14 17:43 UTC (permalink / raw
  To: gentoo-commits

commit:     dc3c5ba810a7fc3c3551ec5201a8d73188c14ac5
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Tue Jun 14 17:42:05 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Tue Jun 14 17:42:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=dc3c5ba8

fix client url

---
 client/send.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/send.py b/client/send.py
index 8bf2bd2..1420a7d 100755
--- a/client/send.py
+++ b/client/send.py
@@ -30,7 +30,7 @@ def main():
   post_headers = {"Content-type": "application/json"}
   myuuid = getAuthInfo()['UUID']
   conn = httplib.HTTPConnection("127.0.0.1:8080")
-  conn.request('POST', '/' + myuuid, headers=post_headers, body=post_body)
+  conn.request('POST', '/host/' + myuuid, headers=post_headers, body=post_body)
   #TODO: Handle exceptions
   response = conn.getresponse()
   print response.status, response.reason



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-08-25 14:49 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-08-25 14:49 UTC (permalink / raw
  To: gentoo-commits

commit:     2f635ddfbd7983a85cddadb5e6acabd88bf8c991
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Thu Aug 25 14:48:40 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Thu Aug 25 14:48:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=2f635ddf

ConfigParser hates leading spaces before items

---
 client/payload.cfg |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/client/payload.cfg b/client/payload.cfg
index a90a7c8..1ed0c3b 100644
--- a/client/payload.cfg
+++ b/client/payload.cfg
@@ -1,29 +1,29 @@
 
 [ENV]
 
-# PLATFORM = yes
-# PROFILE = yes
-# LASTSYNC = yes
-# ARCH = yes
-# CHOST = yes
-# CFLAGS = yes
-# CXXFLAGS = yes
-# FFLAGS = yes
-# LDFLAGS = yes
-# MAKEOPTS = yes
-# SYNC = yes
-# ACCEPT_KEYWORDS = yes
-# GENTOO_MIRRORS = yes
-# FEATURES = yes
-# USE = yes
+#PLATFORM = yes
+#PROFILE = yes
+#LASTSYNC = yes
+#ARCH = yes
+#CHOST = yes
+#CFLAGS = yes
+#CXXFLAGS = yes
+#FFLAGS = yes
+#LDFLAGS = yes
+#MAKEOPTS = yes
+#SYNC = yes
+#ACCEPT_KEYWORDS = yes
+#GENTOO_MIRRORS = yes
+#FEATURES = yes
+#USE = yes
 
 [PACKAGES]
 
-# REPO = yes
-# KEYWORD = yes
-# USE_PLUS = yes
-# USE_MINUS = yes
-# USE_UNSET = yes
-# COUNTER = yes
-# SIZE = yes
-# BUILD_TIME = yes
+#REPO = yes
+#KEYWORD = yes
+#USE_PLUS = yes
+#USE_MINUS = yes
+#USE_UNSET = yes
+#COUNTER = yes
+#SIZE = yes
+#BUILD_TIME = yes



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-08-21 14:42 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-08-21 14:42 UTC (permalink / raw
  To: gentoo-commits

commit:     baebb403cd1fd451e5d6c9dbb9f51cc509b917fd
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Sun Aug 21 14:06:31 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Sun Aug 21 14:06:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=baebb403

commented gentoostats-send

---
 client/gentoostats-send |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/client/gentoostats-send b/client/gentoostats-send
index 631a331..49dcb83 100755
--- a/client/gentoostats-send
+++ b/client/gentoostats-send
@@ -8,6 +8,9 @@ import urllib, httplib
 from gentoostats.payload import Payload
 
 def getAuthInfo(auth):
+    """
+    Read auth config
+    """
     config = ConfigParser.ConfigParser()
     if len(config.read(auth)) == 0:
         sys.stderr.write('Cannot read ' + auth)
@@ -23,6 +26,9 @@ def getAuthInfo(auth):
         sys.exit(1)
 
 def serialize(object, human=False):
+    """
+    Encode using json
+    """
     if human:
         indent = 2
         sort_keys = True



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-08-20 19:26 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-08-20 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     90ed6091068a1ee6b3378f26378c57f7520a8153
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Sat Aug 20 13:37:03 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Sat Aug 20 13:37:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=90ed6091

add gentoostats-cli to setup.py

---
 client/setup.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/setup.py b/client/setup.py
index c018ccc..7240c00 100644
--- a/client/setup.py
+++ b/client/setup.py
@@ -10,5 +10,5 @@ setup(
         license = "GPLv3",
         url = "http://soc.dev.gentoo/org/gentoostats",
         packages = ['gentoostats'],
-        scripts = ['gentoostats-send']
+        scripts = ['gentoostats-send', 'gentoostats-cli']
         )



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-07-15 16:27 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-07-15 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     2dc208e1b646c187c0034712d5f475b003fa75c2
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Fri Jul 15 16:26:43 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Fri Jul 15 16:26:43 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=2dc208e1

make verbosity optional

---
 client/gentoostats-send |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/gentoostats-send b/client/gentoostats-send
index 7c39a7a..631a331 100755
--- a/client/gentoostats-send
+++ b/client/gentoostats-send
@@ -38,10 +38,13 @@ def main():
     parser.add_argument('-u', '--url', default='/gentoostats')
     parser.add_argument('-a', '--auth', default='/etc/gentoostats/auth.cfg')
     parser.add_argument('-c', '--config', default='/etc/gentoostats/payload.cfg')
+    parser.add_argument('-v', '--verbose', action='store_true')
     args = vars(parser.parse_args())
 
     pl = Payload(configfile=args['config'])
-    pl.dump(human=True)
+
+    if args['verbose']:
+        pl.dump(human=True)
 
     post_data = pl.get()
     post_data['AUTH'] = getAuthInfo(auth=args['auth'])



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-06-30 10:28 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-06-30 10:28 UTC (permalink / raw
  To: gentoo-commits

commit:     1ffb2e836bca869b5d7c3dc1d5642842ad9a3a3c
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Thu Jun 30 10:25:33 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Thu Jun 30 10:25:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=1ffb2e83

use https instead of http

---
 client/gentoostats-send |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/gentoostats-send b/client/gentoostats-send
index ecc0be8..73d53a2 100755
--- a/client/gentoostats-send
+++ b/client/gentoostats-send
@@ -34,7 +34,7 @@ def serialize(object, human=False):
 def main():
   parser = argparse.ArgumentParser(description='Gentoostats client')
   parser.add_argument('-s', '--server', default='soc.dev.gentoo.org')
-  parser.add_argument('-p', '--port', type = int, default=80)
+  parser.add_argument('-p', '--port', type = int, default=443)
   parser.add_argument('-u', '--url', default='/gentoostats')
   parser.add_argument('-a', '--auth', default='/etc/gentoostats/auth.cfg')
   parser.add_argument('-c', '--config', default='/etc/gentoostats/payload.cfg')
@@ -54,7 +54,7 @@ def main():
   post_body = serialize(post_data,human=True)
   post_headers = {'Content-type':'application/json'}
 
-  conn = httplib.HTTPConnection(args['server'] + ':' + str(args['port']))
+  conn = httplib.HTTPSConnection(args['server'] + ':' + str(args['port']))
   conn.request('POST', url=post_url, headers=post_headers, body=post_body)
 
   #TODO: Handle exceptions



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-06-19 18:11 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-06-19 18:11 UTC (permalink / raw
  To: gentoo-commits

commit:     76dc7f6db42c5cd8ff4862308fafa2e7a0b7a8df
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Sun Jun 19 18:10:21 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Sun Jun 19 18:10:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=76dc7f6d

update client to handle uuid and passwd

---
 client/gentoostats-send |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/client/gentoostats-send b/client/gentoostats-send
index d749c2a..9a9cd39 100755
--- a/client/gentoostats-send
+++ b/client/gentoostats-send
@@ -1,24 +1,33 @@
 #!/usr/bin/env python
 
 from gentoostats.payload import Payload
+import ConfigParser
+import sys
 import json
 import urllib, httplib
 
 def getAuthInfo():
-  #TODO: Return public uuid and md5sum of password
-  auth_info = {
-      "UUID": "254e308c-d6a0-405c-aa1f-f21d9c1ea6e1",
-      "PASSWD": "5f4dcc3b5aa765d61d8327deb882cf99"
-      }
-  return auth_info
+  config = ConfigParser.ConfigParser()
+  if len(config.read('/etc/gentoostats/auth.cfg')) == 0:
+	sys.stderr.write('Cannot read auth.cfg')
+	sys.exit(1)
+
+  try:
+	uuid = config.get('AUTH', 'UUID')
+	passwd = config.get('AUTH', 'PASSWD')
+	auth_info = {'UUID' : uuid, 'PASSWD' : passwd}
+	return auth_info
+  except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+	sys.stderr.write('Malformed auth.cfg')
+	sys.exit(1)
 
 def serialize(object, human=False):
   if human:
-    indent = 2
-    sort_keys = True
+	indent = 2
+	sort_keys = True
   else:
-    indent = None
-    sort_keys = False
+  	indent = None
+	sort_keys = False
   return json.JSONEncoder(indent=indent, sort_keys=sort_keys).encode(object)
 
 def main():



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-06-07 19:07 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-06-07 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     a0c3f3a282ddc0b8c4b5250711dab9cb91a6fd9a
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Tue Jun  7 19:06:12 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Tue Jun  7 19:06:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=a0c3f3a2

SYNC can have only one url

---
 client/payload.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/payload.py b/client/payload.py
index b888af9..92fb851 100644
--- a/client/payload.py
+++ b/client/payload.py
@@ -18,10 +18,10 @@ class Payload(object):
     self.payload['LASTSYNC'] = env.getLastSync()
     self.payload['PROFILE'] = env.getProfile()
 
-    for var in ['ARCH','CFLAGS','CXXFLAGS','FFLAGS','LDFLAGS','MAKEOPTS']:
+    for var in ['ARCH','CHOST','CFLAGS','CXXFLAGS','FFLAGS','LDFLAGS','MAKEOPTS','SYNC']:
       self.payload[var] = env.getVar(var)
 
-    for var in ['ACCEPT_KEYWORDS','LANG','GENTOO_MIRRORS','SYNC','FEATURES','USE']:
+    for var in ['ACCEPT_KEYWORDS','LANG','GENTOO_MIRRORS','FEATURES','USE']:
       self.payload[var] = env.getVar(var).split()
 
     self.payload['PACKAGES'] = dict()



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [gentoo-commits] proj/gentoostats:master commit in: client/
@ 2011-05-06 12:45 Vikraman Choudhury
  0 siblings, 0 replies; 9+ messages in thread
From: Vikraman Choudhury @ 2011-05-06 12:45 UTC (permalink / raw
  To: gentoo-commits

commit:     994b501a913466e8fff523fc9c69ae4dedbcd746
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Fri May  6 12:45:24 2011 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Fri May  6 12:45:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=994b501a

add optional sort param

---
 client/packages.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/client/packages.py b/client/packages.py
index 4e2bdcd..73cdfc5 100644
--- a/client/packages.py
+++ b/client/packages.py
@@ -3,10 +3,15 @@ import logging
 from dbapi import VARDB
 
 class Packages(object):
-  def getInstalledCPs(self):
-    installed_cps = sorted(VARDB.cp_all())
+
+  def getInstalledCPs(self, sort=False):
+    installed_cps = VARDB.cp_all()
+    if sort:
+      return sorted(installed_cps)
     return installed_cps
 
-  def getInstalledCPVs(self):
-    installed_cpvs = sorted(VARDB.cpv_all())
+  def getInstalledCPVs(self,sort=False):
+    installed_cpvs = VARDB.cpv_all()
+    if sort:
+      return installed_cpvs
     return installed_cpvs



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-25 14:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 17:43 [gentoo-commits] proj/gentoostats:master commit in: client/ Vikraman Choudhury
  -- strict thread matches above, loose matches on Subject: below --
2011-08-25 14:49 Vikraman Choudhury
2011-08-21 14:42 Vikraman Choudhury
2011-08-20 19:26 Vikraman Choudhury
2011-07-15 16:27 Vikraman Choudhury
2011-06-30 10:28 Vikraman Choudhury
2011-06-19 18:11 Vikraman Choudhury
2011-06-07 19:07 Vikraman Choudhury
2011-05-06 12:45 Vikraman Choudhury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox