Skip to content
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

Create ${expldir}/${robot} directory if it does not exists #421

Merged
merged 1 commit into from
Oct 5, 2018
Merged

Create ${expldir}/${robot} directory if it does not exists #421

merged 1 commit into from
Oct 5, 2018

Conversation

k0lter
Copy link
Contributor

@k0lter k0lter commented Sep 24, 2018

Sometimes (while manually creating a robot) in testing or production mode, it could be useful to have this feature implemented.

  1. It makes possible to load the robot configuration (from the wwsympa side) without issues even if ${expldir}/${robot} does not exists
  2. It makes possible to create a first list even if ${expldir}/${robot} does not exists

Feel free to reject it if you think it is not suitable.

Maybe this PR could help people to save time.

@ikedas
Copy link
Member

ikedas commented Sep 25, 2018

Hi @k0lter,

At the moment we have to support old-style list path ${expldir}/${listname}/ along with ${expldir}/${robot}/${listname}/ (cf. doc: See Note).

We may have to give up old-style path, and ${robot} directory will be created at the time of list creation.

@@ -842,6 +842,9 @@ sub load {

## Set of initializations ; only performed when the config is first loaded
if ($options->{'first_access'}) {
if ($robot && (! -d "$Conf::Conf{'home'}/$robot")) {
mkdir "$Conf::Conf{'home'}/$robot", 0775
Copy link
Member

@ikedas ikedas Sep 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep compatibility with older style path ${expldir}/${listname}, I think this is better:

        if ($robot && (! -d "$Conf::Conf{'home'}/$robot")
            && $robot ne $Conf::Conf{'domain'}) {
            mkdir ...

in case some lists have already had ${expldir}/${name} directories.

@ikedas
Copy link
Member

ikedas commented Sep 26, 2018

Issue #106 is a related topic.

@ikedas ikedas added the bug label Oct 1, 2018
@ikedas ikedas added this to the 6.2.38 milestone Oct 1, 2018
@ikedas ikedas merged commit 55f301c into sympa-community:sympa-6.2 Oct 5, 2018
ikedas added a commit to ikedas/sympa that referenced this pull request Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants