Repository: cobbler/cobbler

Issue:
Adding snippet via UI retains path
### Describe the bug

I added a snippet via the UI and it shows the snippet in the list with the full path `var/lib/cobbler/snippets/name` prefixed. So use the snippet in a template i have to do the whole path.  and it turns out that the full path got created recursively as `/var/lib/snippets/var/lib/snippets`

```
[root@bootstrap-n01 snippets]# pwd
/var/lib/cobbler/snippets/var/lib/cobbler/snippets
[root@bootstrap-n01 snippets]# ls
root_authorized_key
```

### To Reproduce

1. Open web ui
2. Goto snippet and click add
3. Add the snippet
4. Look at snippet list, and see the path

### Expected behavior

Should just see the filename in the list, and be able to reference it with just `$SNIPPET('filename')`

### Version

```
[root@bootstrap-n01 snippets]# cobbler version
Cobbler 3.2.0
  source: ?, ?
  build time: Sun Oct 25 21:46:20 2020
```

### Screenshots

![image](https://user-images.githubusercontent.com/372939/103258241-071a9900-495a-11eb-912b-719bbbe198cd.png)


Discussion:
Annoyingly enough.... there isnt a log?

```
]# grep 'write_autoinstall_template' /var/log/* -r
/var/log/cobbler/cobbler.log:2020-12-28T14:03:54 - INFO | REMOTE write_autoinstall_template; user(cobbler); name(desktop.ks)
/var/log/cobbler/cobbler.log:2020-12-28T14:03:54 - DEBUG | authorize; ['cobbler', 'write_autoinstall_template', 'desktop.ks', True, True]
/var/log/cobbler/cobbler.log:2020-12-28T16:01:52 - INFO | REMOTE write_autoinstall_template; user(cobbler); name(desktop.ks)
/var/log/cobbler/cobbler.log:2020-12-28T16:01:52 - DEBUG | authorize; ['cobbler', 'write_autoinstall_template', 'desktop.ks', True, True]
/var/log/cobbler/cobbler.log:2020-12-28T17:45:35 - INFO | REMOTE write_autoinstall_template; user(cobbler); name(desktop.ks)
/var/log/cobbler/cobbler.log:2020-12-28T17:45:35 - DEBUG | authorize; ['cobbler', 'write_autoinstall_template', 'desktop.ks', True, True]
/var/log/cobbler/cobbler.log:2020-12-28T17:46:34 - INFO | REMOTE write_autoinstall_template; user(cobbler); name(desktop.ks)
/var/log/cobbler/cobbler.log:2020-12-28T17:46:34 - DEBUG | authorize; ['cobbler', 'write_autoinstall_template', 'desktop.ks', True, True]
/var/log/logdna-agent.log:     firstLine: '2020-12-28T14:03:54 - INFO | REMOTE write_autoinstall_template; user(cobbler); name(desktop.ks)',
```
It feels like the bug is happening [here](https://github.com/cobbler/cobbler/blob/master/cobbler/autoinstall_manager.py#L222-L241)... but i cant prove it... so i changed it to log a bit... 

```
        self.logger.info('Validating %s path' % (file_path))
        file_path = self.validate_autoinstall_snippet_file_path(file_path, new_snippet=True)

        self.logger.info('Post-validating %s path' % (file_path))
        file_full_path = "%s/%s" % (self.snippets_base_dir, file_path)
        self.logger.info('Full path %s created under %s' % (file_full_path, self.snippets_base_dir))
```

And this is whats in the logs

```
2020-12-28T23:41:53 - INFO | REMOTE write_autoinstall_snippet; user(cobbler); name(/var/lib/cobbler/snippets/test)
2020-12-28T23:41:53 - DEBUG | authorize; ['cobbler', 'write_autoinstall_snippet', '/var/lib/cobbler/snippets/test', True, True]
2020-12-28T23:41:53 - DEBUG | REMOTE cobbler authorization result: True; user(?)
2020-12-28T23:41:53 - INFO | Validating /var/lib/cobbler/snippets/test path
2020-12-28T23:41:53 - INFO | Post-validating /var/lib/cobbler/snippets/test path
2020-12-28T23:41:53 - INFO | Full path /var/lib/cobbler/snippets//var/lib/cobbler/snippets/test created under /var/lib/cobbler/snippets
```

which shows my suspicions were wrong.. its definitely happening earlier.  seems like its coming from `web/views.py` under the `snippet_save` function? which i dont see any way to log from :/ 

ooh... sooo... [here is where its happening](https://github.com/cobbler/cobbler/blob/master/cobbler/web/views.py#L867-L869)

Logs after getting rid of that block 

```
2020-12-28T23:53:44 - INFO | REMOTE write_autoinstall_snippet; user(cobbler); name(test)
2020-12-28T23:53:44 - DEBUG | authorize; ['cobbler', 'write_autoinstall_snippet', 'test', True, True]
2020-12-28T23:53:44 - DEBUG | REMOTE cobbler authorization result: True; user(?)
2020-12-28T23:53:44 - INFO | Validating test path
2020-12-28T23:53:44 - INFO | Post-validating test path
2020-12-28T23:53:44 - INFO | Full path /var/lib/cobbler/snippets/test created under /var/lib/cobbler/snippets
2020-12-28T23:53:44 - INFO | REMOTE get_autoinstall_snippets; user(cobbler)
2020-12-28T23:53:44 - INFO | REMOTE version; user(cobbler)
```

I did verify that templates isn't impacted like this.

Resolving patch:
diff --git a/cobbler/web/views.py b/cobbler/web/views.py
--- a/cobbler/web/views.py
+++ b/cobbler/web/views.py
@@ -864,10 +864,6 @@ def snippet_save(request):
     if snippet_name is None:
         return HttpResponse("NO SNIPPET NAME SPECIFIED")
 
-    if editmode != 'edit':
-        if snippet_name.find("/var/lib/cobbler/snippets/") != 0:
-            snippet_name = "/var/lib/cobbler/snippets/" + snippet_name
-
     delete1 = request.POST.get('delete1', None)
     delete2 = request.POST.get('delete2', None)
 


Test patch: