summaryrefslogtreecommitdiff
path: root/trove/backup
diff options
context:
space:
mode:
authorRobert Myers <robert.myers@rackspace.com>2014-09-27 19:25:59 -0500
committerRobert Myers <robert.myers@rackspace.com>2014-10-06 10:21:20 -0500
commit0007a5076aa795fc354b122ae591980c9413f054 (patch)
tree188b08d2534eb32950d616eba13afaaf04495ee6 /trove/backup
parentd8f0c4ab6dce440503257dfae4b92cd156170de6 (diff)
downloadtrove-0007a5076aa795fc354b122ae591980c9413f054.tar.gz
Removing dependency on trove models in the guest agent
Reasons: - The guest agent is importing backup models and agent heartbeat, this triggers the all of the trove database setup logic which bloats the guest process on the host. - Moving the state to its own module and removing an unused function decreases the memory usage by about 15 - 20 megs. Closes-Bug: #1375311 Change-Id: I126c0b89c170b325d85b3f09afca399b4f5de9e8
Diffstat (limited to 'trove/backup')
-rw-r--r--trove/backup/models.py12
-rw-r--r--trove/backup/state.py26
2 files changed, 27 insertions, 11 deletions
diff --git a/trove/backup/models.py b/trove/backup/models.py
index eba19f4f..023e5e7d 100644
--- a/trove/backup/models.py
+++ b/trove/backup/models.py
@@ -17,6 +17,7 @@
from sqlalchemy import desc
from swiftclient.client import ClientException
+from trove.backup.state import BackupState
from trove.common import cfg
from trove.common import exception
from trove.db.models import DatabaseModelBase
@@ -33,17 +34,6 @@ CONF = cfg.CONF
LOG = logging.getLogger(__name__)
-class BackupState(object):
- NEW = "NEW"
- BUILDING = "BUILDING"
- SAVING = "SAVING"
- COMPLETED = "COMPLETED"
- FAILED = "FAILED"
- DELETE_FAILED = "DELETE_FAILED"
- RUNNING_STATES = [NEW, BUILDING, SAVING]
- END_STATES = [COMPLETED, FAILED, DELETE_FAILED]
-
-
class Backup(object):
@classmethod
diff --git a/trove/backup/state.py b/trove/backup/state.py
new file mode 100644
index 00000000..b0c46766
--- /dev/null
+++ b/trove/backup/state.py
@@ -0,0 +1,26 @@
+# Copyright 2014 OpenStack Foundation
+# 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 BackupState(object):
+ NEW = "NEW"
+ BUILDING = "BUILDING"
+ SAVING = "SAVING"
+ COMPLETED = "COMPLETED"
+ FAILED = "FAILED"
+ DELETE_FAILED = "DELETE_FAILED"
+ RUNNING_STATES = [NEW, BUILDING, SAVING]
+ END_STATES = [COMPLETED, FAILED, DELETE_FAILED]