Chnage share name on AFP

Is there a simple way to remove the on rockstor ending of a share. I am trying to setup automount, but I do not like having spaces in the share name.

It may be possible, we need to look into it. Could you open an issue on github please?

I am fix this issue for me by edit /opt/rockstor/src/rockstor/system/services.py.
changing proc:

def rockstor_afp_config(fo, afpl):
fo.write(’;####BEGIN: Rockstor AFP CONFIG####\n’)
for c in afpl:
vol_size = int(c.vol_size / 1024)
sn = c.description
sn = string.replace(sn, ’ on Rockstor’, ‘’)
#sn = sn.replace(’ on Rockstor’, ‘’)
#fo.write(’;# %s\n’ % sn)
#fo.write(’[%s]\n’ % c.description)
fo.write(’[%s]\n’ % sn)
fo.write(’ path = %s\n’ % c.path)
fo.write(’ time machine = %s\n’ % c.time_machine)
fo.write(’ vol size limit = %d\n\n’ % vol_size)
fo.write(’;####END: Rockstor AFP CONFIG####\n’)

@fva.taimyr Welcome to the Rockstor community and thanks for sharing your fix.

But I would suggest that it will be of more use to others, and less misleading, if you ‘undid’ your edits to the BEGIN: and END: lines as elsewhere in the code (in the very next procedure):

these lines are read back in to discern where the prior machine editing begins. Hence your suggested changes will break all future UI initiated AFP edits.

However that’s easily fixed.

Do you fancy popping in a pull request against the indicated issue, given you have essentially sorted the problem? Although I think sticking with the original marker text would be preferred :slight_smile:.

We have the following long standing issue awaiting your suggested fix:

https://github.com/rockstor/rockstor-core/issues/1347

Where I have linked back to your post for context.

Let us know if you are game to have a go at a pull request for this one. If not I can try and pick it up after I’ve dealt with my current back log.

Cheers.

@phillxnet Sorry for my “pure” english.
I’am fix my post!

@fva.taimyr

Thanks; and I forgot to link to our Developers subsection of the Contributing to Rockstor - Overview doc that should be of help if you fancy having a go at that pull request. I’m pretty sure it would be a welcome addition as we have had a duplicate of the indicated issue come up again just recently.

On a related note, the approach your fix takes is a little on the ‘post processing’ side, ie it adjusts what is already there. As an alternative if we look to:

and later in the same file:

and finally from what I can tell with a quick look:

this behaviour could be addressed earlier in the code path as it were.

So it might be better to deal with this issue at the source and make the desired change in the above code segments instead.

Just a thought as I’ve only just looked into this one given your prompt.

Thank u! I think better way to fix this issue is to fix them in netatalk.py.

I did not look so far into the source code. Just offered a simple solution.

What is the description of the share for? Usually use the server name as the description.

i found some thing:

Tomorrow I will try to fix this in my server and check working.

Sorry for my english.

Regards.

@phillxnet I found another way to fix this issue. How can I post it?

@fva.taimyr Hello again:

That great news. Ideally you would submit a GitHub pull request so that your code changes can be reviewed and possibly modified via the GitHub / git tools. The instructions on how to go about doing this are available in our following doc entry: Developers that way you can be auto credited with the changes you submit. It’s a bit of a pain if you are unfamiliar git and GitHub but well worth the effort once you get it set up. Plus those instructions are pretty step-by-step.

Hope that helps answer your question and if you have any issue do please ask here as it would be great to see / have your proposed fix.

Thanks for putting the time into this issue and sharing your findings and if all else fails you can post your changes here as you did before: but far better to get them into git / GitHub and properly attributed as per the included link.