

def create_all():

    import sys
    if not sys.executable.endswith(('python', )):
        # auto add session to only standalone python runs
        return

    from solar.dblayer.model import ModelMeta

    import atexit

    ModelMeta.session_start()

    atexit.register(ModelMeta.session_end)



def create_all():

    import sys
    if sys.executable.split('/')[-1] not in ['python', 'python2']:
        # auto add session to only standalone python runs
        return

    from solar.dblayer.model import ModelMeta

    import atexit

    ModelMeta.session_start()

    atexit.register(ModelMeta.session_end)

Fix session in CLI on Debian systems
Fix session in CLI on Debian systems

Change-Id: I4b1a3e45417a8d8442e097d440ebee8a09a8aaa2

  
  
  def create_all():
  
      import sys
-     if not sys.executable.endswith(('python', )):
+     if sys.executable.split('/')[-1] not in ['python', 'python2']:
          # auto add session to only standalone python runs
          return
  
      from solar.dblayer.model import ModelMeta
  
      import atexit
  
      ModelMeta.session_start()
  
      atexit.register(ModelMeta.session_end)
  
Fix session in CLI on Debian systems
## Code Before:


def create_all():

    import sys
    if not sys.executable.endswith(('python', )):
        # auto add session to only standalone python runs
        return

    from solar.dblayer.model import ModelMeta

    import atexit

    ModelMeta.session_start()

    atexit.register(ModelMeta.session_end)

## Instruction:
Fix session in CLI on Debian systems
## Code After:


def create_all():

    import sys
    if sys.executable.split('/')[-1] not in ['python', 'python2']:
        # auto add session to only standalone python runs
        return

    from solar.dblayer.model import ModelMeta

    import atexit

    ModelMeta.session_start()

    atexit.register(ModelMeta.session_end)
