- Timestamp:
- Mar 4, 2012 6:45:19 PM (13 years ago)
- Branches:
- compt_changes, master
- Children:
- 6527d60
- Parents:
- 2bb8b35
- Location:
- fedd/federation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/access.py
r2bb8b35 r8cab4c2 784 784 """ 785 785 786 self.log.info("RequestAccess called by %s" % fid) 786 787 # The dance to get into the request body 787 788 if req.has_key('RequestAccessRequestBody'): … … 829 830 checked and if valid, the state and cached certificate are destroyed. 830 831 """ 832 self.log.info("ReleaseAccess called by %s" % fid) 831 833 # The dance to get into the request body 832 834 if req.has_key('ReleaseAccessRequestBody'): … … 871 873 self.log.debug("[ReleaseAccess] Removing %s" % cf) 872 874 os.remove(cf) 875 self.log.info("ReleaseAccess succeeded for %s" % fid) 873 876 return { 'allocID': req['allocID'], 'proof': proof.to_dict() } 874 877 else: -
fedd/federation/emulab_access.py
r2bb8b35 r8cab4c2 241 241 return rv 242 242 243 self.log.info("RequestAccess called by %s" % fid) 243 244 # The dance to get into the request body 244 245 if req.has_key('RequestAccessRequestBody'): … … 291 292 f.close() 292 293 except EnvironmentError, e: 294 self.log.info("RequestAccess failed for by %s: internal error" \ 295 % fid) 293 296 raise service_error(service_error.internal, 294 297 "Can't open %s/%s : %s" % (self.certdir, aid, e)) 298 self.log.debug('RequestAccess Returning allocation ID: %s' % allocID) 295 299 resp = self.build_access_response({ 'fedid': allocID } , 296 300 pname, services, proof) … … 298 302 299 303 def ReleaseAccess(self, req, fid): 304 self.log.info("ReleaseAccess called by %s" % fid) 300 305 # The dance to get into the request body 301 306 if req.has_key('ReleaseAccessRequestBody'): … … 335 340 self.log.debug("Removing %s" % cf) 336 341 os.remove(cf) 342 self.log.info("ReleaseAccess succeeded for %s" % fid) 337 343 return { 'allocID': req['allocID'], 'proof': proof.to_dict() } 338 344 else: … … 811 817 rv = None # Return value from segment creation 812 818 819 self.log.info("StartSegment called by %s" % fid) 813 820 try: 814 821 req = req['StartSegmentRequestBody'] … … 826 833 with_proof=True) 827 834 if not access_ok: 835 self.log.info("StartSegment for %s failed: access denied" % fid) 828 836 raise service_error(service_error.access, "Access denied") 829 837 else: … … 852 860 os.mkdir(softdir) 853 861 except EnvironmentError: 862 self.log.info("StartSegment for %s failed: internal error" % fid) 854 863 raise service_error(service_error.internal, "Cannot create tmp dir") 855 864 … … 884 893 rv = starter(self, ename, proj, user, expfile, tmpdir, gid=gid) 885 894 except service_error, e: 895 self.log.info("StartSegment for %s failed: %s" % (fid, e)) 886 896 err = e 887 897 except: 888 898 t, v, st = sys.exc_info() 899 self.log.info("StartSegment for %s failed: unexpected error: %s" \ 900 % (fid, v, traceback.extract_tb(st))) 889 901 err = service_error(service_error.internal, "%s: %s" % \ 890 902 (v, traceback.extract_tb(st))) … … 895 907 896 908 if rv: 909 self.log.info("StartSegment for %s succeeded" % fid) 897 910 return self.finalize_experiment(starter, topo, aid, req['allocID'], 898 911 proof) … … 904 917 905 918 def TerminateSegment(self, req, fid): 919 self.log.info("TerminateSegment called by %s" % fid) 906 920 try: 907 921 req = req['TerminateSegmentRequestBody'] … … 934 948 935 949 if not proj: 950 self.log.info("TerminateSegment failed for %s: cannot find project"\ 951 % fid) 936 952 raise service_error(service_error.internal, 937 953 "Can't find project for %s" % aid) … … 941 957 942 958 if not user: 959 self.log.info("TerminateSegment failed for %s: cannot find user"\ 960 % fid) 943 961 raise service_error(service_error.internal, 944 962 "Can't find creation user for %s" % aid) 945 963 if not ename: 964 self.log.info( 965 "TerminateSegment failed for %s: cannot find experiment"\ 966 % fid) 946 967 raise service_error(service_error.internal, 947 968 "Can't find experiment name for %s" % aid) … … 950 971 cert=xmlrpc_cert) 951 972 stopper(self, user, proj, ename, gid, nonce) 973 self.log.info("TerminateSegment succeeded for %s %s %s" % \ 974 (fid, proj, ename)) 952 975 return { 'allocID': req['allocID'], 'proof': proof.to_dict() } 953 976 954 977 def InfoSegment(self, req, fid): 978 self.log.info("InfoSegment called by %s" % fid) 955 979 try: 956 980 req = req['InfoSegmentRequestBody'] … … 983 1007 984 1008 if not proj: 1009 self.log.info("InfoSegment failed for %s: cannot find project"% fid) 985 1010 raise service_error(service_error.internal, 986 1011 "Can't find project for %s" % aid) … … 990 1015 991 1016 if not user: 1017 self.log.info("InfoSegment failed for %s: cannot find user"% fid) 992 1018 raise service_error(service_error.internal, 993 1019 "Can't find creation user for %s" % aid) 994 1020 if not ename: 1021 self.log.info("InfoSegment failed for %s: cannot find exp"% fid) 995 1022 raise service_error(service_error.internal, 996 1023 "Can't find experiment name for %s" % aid) … … 999 1026 cert=xmlrpc_cert) 1000 1027 info(self, user, proj, ename) 1028 self.log.info("InfoSegment gathered info for %s %s %s %s" % \ 1029 (fid, user, proj, ename)) 1001 1030 self.decorate_topology(info, topo) 1002 1031 self.state_lock.acquire() … … 1005 1034 self.write_state() 1006 1035 self.state_lock.release() 1036 self.log.info("InfoSegment updated info for %s %s %s %s" % \ 1037 (fid, user, proj, ename)) 1007 1038 1008 1039 rv = { … … 1010 1041 'proof': proof.to_dict(), 1011 1042 } 1043 self.log.info("InfoSegment succeeded info for %s %s %s %s" % \ 1044 (fid, user, proj, ename)) 1012 1045 if topo: 1013 1046 rv['segmentdescription'] = { 'topdldescription' : topo.to_dict() } … … 1024 1057 return None 1025 1058 1059 self.log.info("OperationSegment called by %s" % fid) 1026 1060 try: 1027 1061 req = req['OperationSegmentRequestBody'] … … 1035 1069 with_proof=True) 1036 1070 if not access_ok: 1071 self.log.info("OperationSegment failed for %s: access denied" % fid) 1037 1072 raise service_error(service_error.access, "Access denied") 1038 1073 … … 1042 1077 1043 1078 if op is None : 1079 self.log.info("OperationSegment failed for %s: no operation" % fid) 1044 1080 raise service_error(service_error.req, "missing operation") 1045 1081 elif targets is None: 1082 self.log.info("OperationSegment failed for %s: no targets" % fid) 1046 1083 raise service_error(service_error.req, "no targets") 1047 1084 … … 1072 1109 cert=xmlrpc_cert) 1073 1110 ops(self, op, ptargets, params, topo) 1111 self.log.info("OperationSegment operated for %s" % fid) 1074 1112 1075 1113 status.extend(ops.status) 1114 self.log.info("OperationSegment succeed for %s" % fid) 1076 1115 1077 1116 return { -
fedd/federation/experiment_control.py
r2bb8b35 r8cab4c2 1661 1661 self.auth.save() 1662 1662 1663 access_ok, proof = self.auth.check_attribute(fid, 'new', 1664 with_proof=True) 1663 try: 1664 access_ok, proof = self.auth.check_attribute(fid, 'new', 1665 with_proof=True) 1666 except service_error, e: 1667 self.log.info("New experiment call for %s: access denied" % fid) 1668 raise e 1669 1665 1670 1666 1671 if not access_ok: … … 1998 2003 raise service_error(service_error.req, "No request?") 1999 2004 2000 proof = self.check_experiment_access(fid, key) 2005 try: 2006 proof = self.check_experiment_access(fid, key) 2007 except service_error, e: 2008 self.log.info("vtopo call failed for %s: access denied" % fid) 2009 raise e 2001 2010 2002 2011 self.state_lock.acquire() … … 2053 2062 raise service_error(service_error.req, "No request?") 2054 2063 2055 proof = self.check_experiment_access(fid, key) 2064 try: 2065 proof = self.check_experiment_access(fid, key) 2066 except service_error, e: 2067 self.log.info("vis call failed for %s: access denied" % fid) 2068 raise e 2056 2069 2057 2070 self.state_lock.acquire() … … 2155 2168 self.auth.save() 2156 2169 2157 # Make sure that the caller can talk to us 2158 proof = self.check_experiment_access(fid, key) 2170 try: 2171 # Make sure that the caller can talk to us 2172 proof = self.check_experiment_access(fid, key) 2173 except service_error, e: 2174 self.log.info("Create experiment call failed for %s: access denied"\ 2175 % fid) 2176 raise e 2177 2159 2178 2160 2179 # Install the testbed map entries supplied with the request into a copy … … 2398 2417 raise service_error(service_error.req, "No request?") 2399 2418 2400 proof = self.check_experiment_access(fid, key) 2419 try: 2420 proof = self.check_experiment_access(fid, key) 2421 except service_error, e: 2422 self.log.info("Info call failed for %s: access denied" % fid) 2423 2401 2424 2402 2425 self.update_info(key, fresh) … … 2498 2521 else: return None 2499 2522 2523 self.log.info("Operation call started for %s" % fid) 2500 2524 req = req.get('OperationRequestBody', None) 2501 2525 if not req: … … 2522 2546 raise service_error(service_error.req, "No request?") 2523 2547 2524 proof = self.check_experiment_access(fid, key) 2548 try: 2549 proof = self.check_experiment_access(fid, key) 2550 except service_error, e: 2551 self.log.info("Operation call failed for %s: access denied" % fid) 2552 raise e 2553 2525 2554 self.state_lock.acquire() 2526 2555 if key in self.state: … … 2534 2563 2535 2564 if top is None: 2565 self.log.info("Operation call failed for %s: not active" % fid) 2536 2566 raise service_error(service_error.partial, "No topology yet", 2537 2567 proof=proof) … … 2558 2588 results) 2559 2589 2590 self.log.info("Operation call succeeded for %s" % fid) 2560 2591 return { 2561 2592 'experiment': exp, … … 2720 2751 2721 2752 key = self.get_experiment_key(req, 'experiment') 2722 proof = self.check_experiment_access(fid, key) 2753 try: 2754 proof = self.check_experiment_access(fid, key) 2755 except service_error, e: 2756 self.log.info( 2757 "Terminate experiment call failed for %s: access denied" \ 2758 % fid) 2759 raise e 2723 2760 exp = req.get('experiment', False) 2724 2761 force = req.get('force', False)
Note: See TracChangeset
for help on using the changeset viewer.