def sendMail(_message): # send a mail to the user _user = os.getlogin() _totalmessage = "<p>%s</p>"%(_message) _subject = "Attempted DELIVERY from RV by %s"%_user try: send_email(subject=_subject, message=_totalmessage, tolist=[_user,"mattg"], sender='mattg', cclist=None) except: logger.warn("Couldnt send email") pass
def doit(): arguments = parseArguments() if not (parseArguments()): logger.critical("Cant parse args %s"%(arguments)) sys.exit("Cant pass args") else: utils.Helper.printDict(arguments.__dict__,"ARGS") if arguments.input == None: sys.exit("Error: No input provided") if arguments.output == None: sys.exit("Error: No output provided") cmd=[] cmd.append(' %s '%("cp ")) _finalOutput=arguments.output[0] _input=arguments.input[0] _downstream = False _matchstring=arguments.matchstring[0] ''' 09:31:40| creating root holding directory: /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/.holding_1369867160652 09:31:40| creating holding directory: /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/.holding_1369867160652 09:31:40| Running proxy gen command: /film/custom/apps/ark/metro/bin/proxy_runner.sh -p /usr/bin/env python -m AL.apps.Binocular.proxy.localiseDependecy --matchstring CACHERES -i /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/052ea_040_prebuild_light_camera_v009.mb -o /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/.holding_1369867160652/052ea_040_prebuild_light_camera_v009_cameo2nuke.nk -u sandram -c 915 -j kragle 09:31:40| Running proxy command: /usr/bin/env python -m AL.apps.Binocular.proxy.localiseDependecy --matchstring CACHERES -i /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/052ea_040_prebuild_light_camera_v009.mb -o /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/.holding_1369867160652/052ea_040_prebuild_light_camera_v009_cameo2nuke.nk -u sandram -c 915 -j kragle 09:31:55| /film/tools/AL_pylib_xsiwipcut/v5.36.2/py26/AL_pylib_xsiwipcut-5.36.2-py2.6.egg/AL/__init__.py:14: UserWarning: Module lxml was already imported from /film/tools/PythonExtensions/v65/py26_linux-x64/lxml/__init__.pyc, but /usr/lib64/python2.6/site-packages is being added to sys.path 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 0 versionid None 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 1 matchstring ['CACHERES'] 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 2 job ['kragle'] 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 3 user ['sandram'] 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 4 output ['/jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/.holding_1369867160652/052ea_040_prebuild_light_camera_v009_cameo2nuke.nk'] 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 5 input ['/jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/052ea_040_prebuild_light_camera_v009.mb'] 09:31:56| INFO AL.apps.Binocular.utilities.utils: ARGS: 6 procdefid ['915'] 09:31:56| No input /jobs/alfx/kragle/052ea/052ea_040/assets/prebuild/light/camera/052ea_040_prebuild_light_camera_v009.mb ''' _input,_ext = os.path.splitext(_input) if os.path.isfile(''.join([_input,'.xinfo'])): try: # see if there is an xinfo file laying about # _finalInput=''.join([_input,'.xinfo']) _finalInput=_input logger.debug("_finalInput %s"%_finalInput) _lpath,_lpathversion = utils.FromAssets.getLpathAndVersionFromAssetPath(_finalInput) logger.debug("_lpath,_lpathversion %s %s"%(_lpath, _lpathversion)) _cameracache= utils.FromAssets.getDependentAssets(lpath=_lpath, version=_lpathversion, downstream=_downstream, lpathFilter=_matchstring) logger.debug("_cameracache %s"%_cameracache) _cache=_cameracache.keys()[0] logger.debug("_cache %s"%_cache) _version=_cameracache[_cache] logger.debug("_version %s"%_version) _target = utils.FromAssets.getAssetFileFromLpath(_cache, _version, ".xag") logger.debug("_target %s"%_target) _finalInput = "%s%s"%(os.path.splitext(_target)[0],"_cameo2nuke.nk") logger.info("Final Input : %s"% _finalInput) logger.info("Final Output : %s"% _finalOutput) except Exception,err: logger.critical("Looking to checkin the layout _camera2nuke.nk proxy of the layout camera cache %s as a prebuild camera"%_finalInput) logger.critical("Found these dependent caches in xinfo file - %s"%err) _message='''<p>LOCALISE CAMERA PROXY: </p> <p>Cant get dependency to camera cache in <p>%s</p> </p> <p>try calling Shot Setup Guys, we need that dependency :) </p>'''%_input _user = arguments.user[0] _cc=["mattg"]#"aidan" _to=[_user] logger.critical("Sending mail to %s %s"%(_to,_cc)) send_email(subject="Missing Camera Cache Dependency", message=_message, tolist=_to, sender='mattg', cclist=_cc)#"aidan" sys.exit("Probably a Missing Camera Cache Dependency")