Skip to content
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

Import time side effects with validation_instance #26

Open
sriram-mv opened this issue Oct 29, 2014 · 1 comment
Open

Import time side effects with validation_instance #26

sriram-mv opened this issue Oct 29, 2014 · 1 comment
Labels
Milestone

Comments

@sriram-mv
Copy link
Contributor

validation_instance cannot be imported within the api namespace, to check for validations.

@sriram-mv sriram-mv added the bug label Oct 29, 2014
sriram-mv added a commit to sriram-mv/deuce-client that referenced this issue Oct 29, 2014
…ject

- val in __setitem__(self, key, val) is now validated with
  MetadataBlockType Rule and StorageBlockTypeRule

- The current functionality shall be in place till
  rackerlabs#26 is solved

- Some Typos and repeated docstrings corrected

- Tests refactored, to make introduce sorted lists of uuids, instead
  of hardcoding them
sriram-mv added a commit to sriram-mv/deuce-client that referenced this issue Oct 29, 2014
…ject

- val in __setitem__(self, key, val) is now validated with
  MetadataBlockType Rule and StorageBlockTypeRule

- The current functionality shall be in place till
  rackerlabs#26 is solved

- Some Typos and repeated docstrings corrected

- Tests refactored, to make introduce sorted lists of uuids, instead
  of hardcoding them
sriram-mv added a commit to sriram-mv/deuce-client that referenced this issue Oct 29, 2014
…ject

- val in __setitem__(self, key, val) is now validated with
  MetadataBlockType Rule and StorageBlockTypeRule

- The current functionality shall be in place till
  rackerlabs#26 is solved

- Better Error messages when trying to update storage_id, block_id
  given that the operation is not allowed

- Some Typos and repeated docstrings corrected

- Tests refactored, to make introduce sorted lists of uuids, instead
  of hardcoding them
@BenjamenMeyer
Copy link
Contributor

I'm not sure this one is solve-able unless we want to break down common/validation.py and common/validation_instance.py spread them throughout the API modules.

The main issue is that by defining them all in one place you have to have access to the definitions to everything before it can be used. Thus to include in api/block.py it has to be able to know about api.Vault defined in api/vault.py but api/vault.py has to know about api/block.py - it's all a big dependency mess in that manner.

If we truly want to do this, then the two files go away and api/block.py has to provide the validation rules for blocks; api/vault.py has to provide them for Vaults, etc. Only way to get rid of the dependencies.

Now it might be possible to keep common/validation.py and just import the validation rules from the various API modules so they're easy to get to in one place...

@BenjamenMeyer BenjamenMeyer modified the milestone: v0.2 Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants