-
Notifications
You must be signed in to change notification settings - Fork 200
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
Manager
: check if repository container has been initialised
#4889
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -134,14 +134,27 @@ def get_repository_container(self) -> 'Container': | |||||||||
""" | ||||||||||
from disk_objectstore import Container | ||||||||||
|
||||||||||
filepath = os.path.join(self.repository_path, 'container') | ||||||||||
filepath = self._container_path | ||||||||||
container = Container(filepath) | ||||||||||
|
||||||||||
if not container.is_initialised: | ||||||||||
if not self.container_is_initialised: | ||||||||||
container.init_container(clear=True, **self.defaults['repository']) # pylint: disable=unsubscriptable-object | ||||||||||
|
||||||||||
return container | ||||||||||
|
||||||||||
@property | ||||||||||
def container_is_initialised(self): | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am wondering if we should remove
Looking at this more, currently Ok, this was a bit a train of thought and I am now thinking that we should just merge this and then I will do another PR with some proposed interface and name changes. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. Then we can move on and you (@mbercx) can disregard my review comments since it should be updated anyway in the upcoming PR and they are not functionally critical. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, then I will merge this now and include your comments in the next PR. Then we can start testing the migration again. Thanks guys |
||||||||||
"""Check if the container of the profile file repository has already been initialised.""" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
from disk_objectstore import Container | ||||||||||
filepath = self._container_path | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why didn't
Suggested change
|
||||||||||
container = Container(filepath) | ||||||||||
return container.is_initialised | ||||||||||
Comment on lines
+149
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, if this is a more or less "constant" property, you could store it as a private variable and only create the |
||||||||||
|
||||||||||
@property | ||||||||||
def _container_path(self): | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
"""Return the path to the container of the profile file repository.""" | ||||||||||
return os.path.join(self.repository_path, 'container') | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
@property | ||||||||||
def uuid(self): | ||||||||||
"""Return the profile uuid. | ||||||||||
|
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.