Skip to content
This repository
Browse code

first part of part4 complete

  • Loading branch information...
commit 18ac59c34db7303c3c1b54c8c6936dc1b61df2b8 1 parent 8b0f3d1
Remy Baumgarten authored February 28, 2010

Showing 2 changed files with 43 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  main.py
  2. 41  part4.py
3  main.py
@@ -92,7 +92,8 @@ def get_nodes(conn,tablename):
92 92
     url = dictionary["NODEURL"].rstrip()
93 93
     user = dictionary["NODEUSER"]
94 94
     passwd = dictionary["NODEPASSWD"]
95  
-    node = (url,user,passwd)
  95
+    driver = dictionary["NODEDRIVER"]
  96
+    node = (url,user,passwd,driver)
96 97
     nodes.append(node)
97 98
     dictionary = ibm_db.fetch_assoc(stmt)
98 99
   return nodes
41  part4.py
... ...
@@ -0,0 +1,41 @@
  1
+#!/usr/bin/python
  2
+
  3
+from main import *
  4
+import sys
  5
+from ConfigExtractor import ConfigExtractor
  6
+
  7
+if len(sys.argv) is not 3:
  8
+  print "[*] Usage: python part4.py [temp.cfg] [csvfile]"
  9
+  print sys.argv[0],sys.argv[1]
  10
+  print sys.argv.len
  11
+  sys.exit()
  12
+
  13
+# load CSV
  14
+csv_contents = loadCSV(sys.argv[2])
  15
+#print "Loading...",csv_contents
  16
+
  17
+# Get Catalog and Parition Sections
  18
+configuration = ConfigExtractor(sys.argv[1])
  19
+catalog = configuration.getSection('catalog')
  20
+#partition = configuration.getSection('partition')
  21
+
  22
+# Make persistant catalog connection
  23
+conn = ibm_db.pconnect(catalog['hostname'], catalog['username'],catalog['passwd'])
  24
+
  25
+# Get a list of nodes that contain table name
  26
+tablename = "BOOKST"
  27
+nodes = get_nodes(conn, tablename)
  28
+print "Number of Nodes: ",len(nodes)
  29
+# Create a list of connected node objects
  30
+connections = []
  31
+for node in nodes:
  32
+  print node
  33
+  connections.append(node)
  34
+  
  35
+
  36
+
  37
+  
  38
+
  39
+
  40
+
  41
+

0 notes on commit 18ac59c

Please sign in to comment.
Something went wrong with that request. Please try again.