Skip to content

Instantly share code, notes, and snippets.

@lazypower
Created March 8, 2017 16:37
Show Gist options
  • Save lazypower/2e8ae364639504250499c838a33a20e1 to your computer and use it in GitHub Desktop.
Save lazypower/2e8ae364639504250499c838a33a20e1 to your computer and use it in GitHub Desktop.
def determine_storage_location(self):
''' Storage mounts are limited in snap confinement. Default behavior
is to version the database files in $SNAP_DATA. However the user can
attach durable storage, which is mounted in /media. We need a common
method to determine which storage path we are concerned with '''
if is_state('storage.volume.attached'):
return "/media/etcd-data/"
else:
return "/var/snap/etcd/current"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment