예제 #1
0
 def getleases(self, args, flags):
     ip = args[0]
     principle = digest.sha1file(self.clientconf.pubkey)
     leasesdata = nodemgrproxy.nodemgrproxy(ip, nodemgr.PORT).getleases()
     for leasedata in leasesdata:
         l = lease.lease(leasedata)
         if re.match(principle, l.principle):
             print leasedata
     return 0
예제 #2
0
 def gettickets(self, args, flags):
     ip = args[0]
     principle = digest.sha1file(self.clientconf.pubkey)
     ticketsdata = agentproxy.agentproxy(ip, agent.PORT).gettickets()
     for ticketdata in ticketsdata:
         t = ticket.ticket(ticketdata)
         if re.match(principle, t.principle):
             print ticketdata
     return 0
예제 #3
0
 def getleases(self, args, flags):
     ip = args[0]
     principle = digest.sha1file(self.clientconf.pubkey)
     leasesdata = nodemgrproxy.nodemgrproxy(ip, nodemgr.PORT).getleases()
     for leasedata in leasesdata:
         l = lease.lease(leasedata)
         if re.match(principle, l.principle):
             print leasedata
     return 0
예제 #4
0
 def gettickets(self, args, flags):
     ip = args[0]
     principle = digest.sha1file(self.clientconf.pubkey)
     ticketsdata = agentproxy.agentproxy(ip, agent.PORT).gettickets()
     for ticketdata in ticketsdata:
         t = ticket.ticket(ticketdata)
         if re.match(principle, t.principle):
             print ticketdata
     return 0
예제 #5
0
 def deletesshkey(self, sshkey):
     sha1 = digest.sha1file(sshkey, strip=1)
     key = "%s/%s" % (self.sshkeysdir, sha1)
     if os.path.exists(key):
         os.unlink(key)
예제 #6
0
 def savesshkey(self, sshkey):
     sha1 = digest.sha1file(sshkey, strip=1)
     shutil.copy(sshkey, "%s/%s" % (self.sshkeysdir, sha1))
예제 #7
0
 def deletesshkey(self, sshkey):
     sha1 = digest.sha1file(sshkey, strip=1)
     key = "%s/%s" % (self.sshkeysdir, sha1)
     if os.path.exists(key):
         os.unlink(key)
예제 #8
0
 def savesshkey(self, sshkey):
     sha1 = digest.sha1file(sshkey, strip=1)
     shutil.copy(sshkey, "%s/%s" % (self.sshkeysdir, sha1))