summaryrefslogtreecommitdiff
path: root/osprofiler/cmd
diff options
context:
space:
mode:
authorAlexey Yelistratov <ayelistratov@mirantis.com>2016-04-27 18:55:26 +0300
committerAlexey Yelistratov <ayelistratov@mirantis.com>2016-07-04 18:47:01 +0300
commit676a239bef963d3187b69371b0baf137c5ea847c (patch)
tree4b9b3ce905987fc736a059a55d7c1bef418184d3 /osprofiler/cmd
parent638b7f5528bc69610ae29428aeb418c833b5ca86 (diff)
downloadosprofiler-676a239bef963d3187b69371b0baf137c5ea847c.tar.gz
Add backward compatible drivers structure
Change-Id: I3e904d0e456aa6999cd9a02a268f54e6d8b729de Spec: Multi backend support
Diffstat (limited to 'osprofiler/cmd')
-rw-r--r--osprofiler/cmd/commands.py4
-rw-r--r--osprofiler/cmd/exc.py24
-rw-r--r--osprofiler/cmd/shell.py4
3 files changed, 4 insertions, 28 deletions
diff --git a/osprofiler/cmd/commands.py b/osprofiler/cmd/commands.py
index b2700b6..b369c23 100644
--- a/osprofiler/cmd/commands.py
+++ b/osprofiler/cmd/commands.py
@@ -17,7 +17,7 @@ import json
import os
from osprofiler.cmd import cliutils
-from osprofiler.cmd import exc
+from osprofiler import exc
from osprofiler.parsers import ceilometer as ceiloparser
@@ -90,4 +90,4 @@ class TraceCommands(BaseCommand):
with open(args.file_name, "w+") as output_file:
output_file.write(output)
else:
- print (output)
+ print(output)
diff --git a/osprofiler/cmd/exc.py b/osprofiler/cmd/exc.py
deleted file mode 100644
index 0ffc9c9..0000000
--- a/osprofiler/cmd/exc.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2014 Mirantis Inc.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-
-class CommandError(Exception):
- """Invalid usage of CLI."""
-
- def __init__(self, message=None):
- self.message = message
-
- def __str__(self):
- return self.message or self.__class__.__doc__
diff --git a/osprofiler/cmd/shell.py b/osprofiler/cmd/shell.py
index e613a90..ca7dc95 100644
--- a/osprofiler/cmd/shell.py
+++ b/osprofiler/cmd/shell.py
@@ -26,7 +26,7 @@ import argparse
import osprofiler
from osprofiler.cmd import cliutils
from osprofiler.cmd import commands
-from osprofiler.cmd import exc
+from osprofiler import exc
class OSProfilerShell(object):
@@ -235,7 +235,7 @@ def main(args=None):
try:
OSProfilerShell(args)
except exc.CommandError as e:
- print (e.message)
+ print(e.message)
return 1