-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key/value backend #624
Closed
Closed
Key/value backend #624
Changes from 2 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
7035abe
Move statefile into state.file module
moretea 6da031f
Introduce different state state schemes.
moretea 8269650
Rename statefile->state in deployment.py
moretea c73773f
Move file based deployment lock to file state implementation.
moretea 8a4e34a
Fix indenting
moretea bb056ea
Bite the bullet; remove _db references from business objects + rename…
moretea 6cc171a
move get_resources_for
moretea 813a231
move set_deployment_attrs
moretea 7b58934
move del_deployment_attr
moretea 7ed3fd3
move get_deployment_attr
moretea 0db686d
move create_resource
moretea 97e0714
Move most logic in export() to get_all_deployment_attrs in statefile.
moretea 584d658
Make import use an atomic transaction thingy.
moretea 97bda1a
move clone_deployment
moretea 77e9b93
move part of delete_resource
moretea 4d33f93
missed a few _'s
moretea 5649e39
move part of delete to _delete_deployment
moretea 4075901
use state atomic
moretea 5f39278
Move part of logic of rename to _rename_resource
moretea 6605128
oh yeah, I did rename _db to __db!
moretea 5881c06
Use atomic instead of _db
moretea de9d700
Use atomic instead of _db
moretea ff23c1c
move set_resource_attrs
moretea eb2a24a
move del_resource_attr
moretea 47b3a43
move get_resource_attr
moretea 6835823
move part of export to get_all_resource_attrs
moretea 3739051
Use atomic instead of _db
moretea 66dee1d
oh yeah, I did rename _db to __db!
moretea 6254ccb
simple typo's
moretea 2d1a822
Need to pass in object; too much coupling to refactor right now
moretea 20c5e89
missed assigning to local dict
moretea 6c37bbd
typo
moretea 4baebf9
missing subclass function. Just copied for now
moretea 44652be
typo
moretea e238874
locally reachable already
moretea 56c39b7
missed the self parameter
moretea 83b5ca1
use _state.atomic instead of _db
moretea abf3d6e
schema: file -> sqlite3
moretea 0d999cf
Fix _rename_resource, needs resource_id
moretea a08de62
WIP: initial json backend.
moretea 6baf57f
Include the deployment_uuid in the API for modifying resource attributes
moretea 2dfa148
Small bug fixes
moretea 6733fa7
Utilize deployment_uid
moretea 3827e69
Also recognize json's true as a valid bool value
moretea 056ab60
Undo split between state.atomic and state.db
moretea 38aa181
Typo
moretea 4aaf084
Rename file -> sqlite3_file in tests
moretea 6950f37
Rename file -> sqlite3_file in scripts/nixops
moretea 6576e16
Rename file -> sqlite3_file in scripts/nixops
moretea 9d7cf8c
Merge branch 'master' into kv-state
rbvermaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import urlparse | ||
import sys | ||
import file | ||
|
||
class WrongStateSchemeException(Exception): | ||
pass | ||
|
||
def open(url): | ||
url = urlparse.urlparse(url) | ||
scheme = url.scheme | ||
|
||
if scheme == "": | ||
scheme = "file" | ||
|
||
def raise_(ex): | ||
raise ex | ||
|
||
switcher = { | ||
"file": lambda(url): file.StateFile(url.path), | ||
} | ||
|
||
function = switcher.get(scheme, lambda(url): raise_(WrongStateSchemeException("Unknown state scheme!"))) | ||
return function(url) |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import os | ||
from os import path | ||
import nixops.statefile | ||
import nixops.state.file | ||
from tests import db_file | ||
|
||
|
||
class DatabaseUsingTest(object): | ||
_multiprocess_can_split_ = True | ||
|
||
def setup(self): | ||
self.sf = nixops.statefile.StateFile(db_file) | ||
self.sf = nixops.state.file.StateFile(db_file) | ||
|
||
def teardown(self): | ||
self.sf.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import os | ||
import subprocess | ||
import nixops.statefile | ||
|
||
from nose import SkipTest | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: wrong indentation