collorg/halfORM_packager

hop new project - without database and configfile - MissingConfigFile exception

Closed this issue · 1 comments

When trying to create a new package, hop does not create a configuration file to connect to the database.

randomedia-bIV_ALd_ ❯ HALFORM_CONF_DIR=./.half_orm hop new randomedia
HALFORM_CONF_DIR: ./.half_orm
Connection parameters to the database:
. database name (randomedia): 
. user (emixam): 
. password: 
. is it an ident login with a local account? [Y/n] y
Production (False): 
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /mnt/storage/src/malves/randomedia/randomedia/.git/
WARN: creating hop_main branch.
Initializing the patch system for the 'randomedia' database.
Patch system initialized at release '0.0.0'.
Traceback (most recent call last):
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/bin/hop", line 8, in <module>
    sys.exit(main())
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/half_orm_packager/hop.py", line 312, in new
    init_package(model, package_name)
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/half_orm_packager/hop.py", line 214, in init_package
    HGit(HOP).init()
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/half_orm_packager/hgit.py", line 49, in init
    self.__model.reconnect()  # we get the new stuff from db metadata here
  File "/home/emixam/.local/share/virtualenvs/randomedia-bIV_ALd_/lib/python3.9/site-packages/half_orm/model.py", line 143, in _connect
    raise model_errors.MissingConfigFile(os.path.join(CONF_DIR, self.__config_file))
half_orm.model_errors.MissingConfigFile: Missing config file exception: ./.half_orm/randomedia

It only happens when HALFORM_CONF_DIR is not absolute.