def make_dirs(path):
if not os.path.exists(path):
- os.makedirs(path, 0777)
+ os.makedirs(path, 0o777)
def delete_dirs(path):
raise ex
except urllib2.URLError as err:
ret = [2, str(err), resp_status, resp]
- except Exception as ex:
+ except Exception:
logger.error(traceback.format_exc())
logger.error("[%s]ret=%s" % (callid, str(sys.exc_info())))
res_info = str(sys.exc_info())
def post(self, request, vimid):
try:
create_req = json.loads(request.body)
- except Exception as e:
+ except Exception:
return Response(data={'error': 'Fail to decode request body.'},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
def test_make_dirs(self):
path = "/tmp/azure/azure/bin"
- self.assertEqual(os.makedirs(path, 0777), make_dirs(path))
+ self.assertEqual(os.makedirs(path, 0o777), make_dirs(path))
def test_delete_dirs(self):
path = "/tmp/azure/azure/bin"
[tox]
-envlist = py27,pep8
+envlist = py27,pep8, cover
skipsdist = true
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv]
+basepython =
+ py27: python2.7
+ pep8: python2.7
+ cover: python2.7
deps =
-r{toxinidir}/requirements.txt
commands =
commands =
coverage erase
{[testenv]commands}
- coverage xml -i
\ No newline at end of file
+ coverage xml -i