#NEWLINE# def get_instance_path( instance , forceold = False , relative = False ) : #NEWLINE# #INDENT# 'Determine the correct path for instance storage.\n\n    This method determines the directory name for instance storage, while\n    handling the fact that we changed the naming style to something more\n    unique in the grizzly release.\n\n    :param instance: the instance we want a path for\n    :param forceold: force the use of the pre-grizzly format\n    :param relative: if True, just the relative path is returned\n\n    :returns: a path to store information about that instance\n    ' #NEWLINE# pre_grizzly_name = os . path . join ( CONF . instances_path , instance . name ) #NEWLINE# if ( forceold or os . path . exists ( pre_grizzly_name ) ) : #NEWLINE# #INDENT# if relative : #NEWLINE# #INDENT# return instance . name #NEWLINE# #UNINDENT# return pre_grizzly_name #NEWLINE# #UNINDENT# if relative : #NEWLINE# #INDENT# return instance . uuid #NEWLINE# #UNINDENT# return os . path . join ( CONF . instances_path , instance . uuid )