Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
5dce3629
Commit
5dce3629
authored
Jul 23, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
translation and cleanup
parent
352a4166
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
110 additions
and
169 deletions
+110
-169
machines/forms.py
machines/forms.py
+2
-2
machines/migrations/0084_auto_20180623_1651.py
machines/migrations/0084_auto_20180623_1651.py
+12
-16
machines/migrations/0085_auto_20180623_1817.py
machines/migrations/0085_auto_20180623_1817.py
+0
-20
machines/migrations/0086_auto_20180624_1254.py
machines/migrations/0086_auto_20180624_1254.py
+0
-30
machines/models.py
machines/models.py
+10
-12
machines/templates/machines/aff_machines.html
machines/templates/machines/aff_machines.html
+1
-1
machines/templates/machines/aff_sshfingerprint.html
machines/templates/machines/aff_sshfingerprint.html
+14
-12
machines/templates/machines/aff_sshfpralgo.html
machines/templates/machines/aff_sshfpralgo.html
+21
-21
machines/templates/machines/index_sshfingerprint.html
machines/templates/machines/index_sshfingerprint.html
+7
-8
machines/templates/machines/index_sshfpralgo.html
machines/templates/machines/index_sshfpralgo.html
+7
-8
machines/templates/machines/machine.html
machines/templates/machines/machine.html
+14
-17
machines/templates/machines/sidebar.html
machines/templates/machines/sidebar.html
+1
-1
machines/views.py
machines/views.py
+21
-21
No files found.
machines/forms.py
View file @
5dce3629
...
...
@@ -600,7 +600,7 @@ class EditOuverturePortListForm(FormRevMixin, ModelForm):
class
SshFingerprintForm
(
FormRevMixin
,
ModelForm
):
"""Edit
ion d'une sshfingerprint
"""
"""Edit
s a SSH fingerprint.
"""
class
Meta
:
model
=
SshFingerprint
exclude
=
(
'machine'
,)
...
...
@@ -615,7 +615,7 @@ class SshFingerprintForm(FormRevMixin, ModelForm):
class
SshFprAlgoForm
(
FormRevMixin
,
ModelForm
):
"""Edit
ion de la liste des algo pour sshfpr
"""
"""Edit
s a SSH fingerprint algorithm.
"""
class
Meta
:
model
=
SshFprAlgo
fields
=
'__all__'
...
...
machines/migrations/0084_auto_20180623_1651.py
View file @
5dce3629
...
...
@@ -10,7 +10,7 @@ import re2o.mixins
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0083_r
ole
'
),
(
'machines'
,
'0083_r
emove_duplicate_rights
'
),
]
operations
=
[
...
...
@@ -18,11 +18,15 @@ class Migration(migrations.Migration):
name
=
'SshFingerprint'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'hash_entry'
,
models
.
TextField
(
max_length
=
512
)),
(
'comment'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
)),
(
'pub_key_entry'
,
models
.
TextField
(
help_text
=
'SSH public key'
,
max_length
=
2048
)),
(
'comment'
,
models
.
CharField
(
blank
=
True
,
help_text
=
'Comment'
,
max_length
=
255
,
null
=
True
)),
(
'algo'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'machines.SshFprAlgo'
)),
(
'machine'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'machines.Machine'
)),
],
options
=
{
'permissions'
:
((
'view_sshfingerprint'
,
'Peut voir un objet sshfingerprint'
),),
'permissions'
:
((
'view_sshfingerprint'
,
'Can see an SSH fingerprint'
),),
'verbose_name'
:
'SSH fingerprint'
,
'verbose_name_plural'
:
'SSH fingerprints'
},
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
),
...
...
@@ -30,21 +34,13 @@ class Migration(migrations.Migration):
name
=
'SshFprAlgo'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
Text
Field
(
max_length
=
256
)),
(
'name'
,
models
.
Char
Field
(
max_length
=
256
)),
],
options
=
{
'permissions'
:
((
'view_sshfpralgo'
,
'Peut voir un algo de chiffrement'
),),
'permissions'
:
((
'view_sshfpralgo'
,
'Can see an SSH fingerprint algorithm'
),),
'verbose_name'
:
'SSH fingerprint algorithm'
,
'verbose_name_plural'
:
'SSH fingerprint algorithms'
},
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
),
migrations
.
AddField
(
model_name
=
'sshfingerprint'
,
name
=
'algo'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'machines.SshFprAlgo'
),
),
migrations
.
AddField
(
model_name
=
'sshfingerprint'
,
name
=
'machine'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'machines.Machine'
),
),
]
machines/migrations/0085_auto_20180623_1817.py
deleted
100644 → 0
View file @
352a4166
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-06-23 16:17
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0084_auto_20180623_1651'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'sshfpralgo'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
256
),
),
]
machines/migrations/0086_auto_20180624_1254.py
deleted
100644 → 0
View file @
352a4166
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-06-24 10:54
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0085_auto_20180623_1817'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'sshfingerprint'
,
old_name
=
'hash_entry'
,
new_name
=
'pub_key_entry'
,
),
migrations
.
AlterField
(
model_name
=
'sshfingerprint'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
help_text
=
'Commentaire'
,
max_length
=
255
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'sshfingerprint'
,
name
=
'pub_key_entry'
,
field
=
models
.
TextField
(
help_text
=
'Clef publique ssh'
,
max_length
=
2048
),
),
]
machines/models.py
View file @
5dce3629
...
...
@@ -201,14 +201,10 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
return
str
(
self
.
user
)
+
' - '
+
str
(
self
.
id
)
+
' - '
+
str
(
self
.
name
)
class
SshFingerprint
(
RevMixin
,
AclMixin
,
models
.
Model
):
"""Stockage de la clef ssh publique d'une machine
et calcul de ses hash"""
PRETTY_NAME
=
"Clef publique ssh"
"""A fingerpirnt of an SSH public key"""
machine
=
models
.
ForeignKey
(
'Machine'
,
on_delete
=
models
.
CASCADE
)
pub_key_entry
=
models
.
TextField
(
help_text
=
"
Clef publique ssh
"
,
help_text
=
"
SSH public key
"
,
max_length
=
2048
)
algo
=
models
.
ForeignKey
(
...
...
@@ -216,7 +212,7 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
on_delete
=
models
.
PROTECT
)
comment
=
models
.
CharField
(
help_text
=
"Comment
aire
"
,
help_text
=
"Comment"
,
max_length
=
255
,
null
=
True
,
blank
=
True
...
...
@@ -224,8 +220,10 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
class
Meta
:
permissions
=
(
(
"view_sshfingerprint"
,
"
Peut voir un objet ssh
fingerprint"
),
(
"view_sshfingerprint"
,
"
Can see an SSH
fingerprint"
),
)
verbose_name
=
"SSH fingerprint"
verbose_name_plural
=
"SSH fingerprints"
def
can_view
(
self
,
user_request
,
*
_args
,
**
_kwargs
):
return
self
.
machine
.
can_view
(
user_request
,
*
_args
,
**
_kwargs
)
...
...
@@ -241,15 +239,15 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
class
SshFprAlgo
(
RevMixin
,
AclMixin
,
models
.
Model
):
"""Un aglorithme de création de la fingerprint ssh"""
PRETTY_NAME
=
"Algo de clef ssh"
"""An algorithm to compute SSH fingerprints"""
name
=
models
.
CharField
(
max_length
=
256
)
class
Meta
:
permissions
=
(
(
"view_sshfpralgo"
,
"
Peut voir un algo de chiffrement
"
),
(
"view_sshfpralgo"
,
"
Can see an SSH fingerprint algorithm
"
),
)
verbose_name
=
"SSH fingerprint algorithm"
verbose_name_plural
=
"SSH fingerprint algorithms"
def
__str__
(
self
):
return
str
(
self
.
name
)
...
...
machines/templates/machines/aff_machines.html
View file @
5dce3629
...
...
@@ -122,7 +122,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create SshFingerprint interface.machine.id %}
<li>
<a
href=
"{% url 'machines:index-sshfingerprint' interface.machine.id %}"
>
<i
class=
"fa fa-edit"
></i>
Gerer les fingerprint ssh
<i
class=
"fa fa-edit"
></i>
Manage the SSH fingerprints
</a>
</li>
{% acl_end %}
...
...
machines/templates/machines/aff_sshfingerprint.html
View file @
5dce3629
...
...
@@ -21,14 +21,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
<table
class=
"table table-striped long_text"
>
<thead>
<tr>
<th
class=
"long_text"
>
Entrée du hash
</th>
<th>
Algorithme utilisé
</th>
<th>
Commentaire
</th>
<th></th>
<th
class=
"long_text"
>
SSH public key
</th>
<th>
Algorithm used
</th>
<th>
Comment
</th>
<th></th>
</tr>
</thead>
{% for sshfpr in sshfingerprint_list %}
...
...
@@ -36,14 +38,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td
class=
"long_text"
>
{{ sshfpr.pub_key_entry }}
</td>
<td>
{{ sshfpr.algo }}
</td>
<td>
{{ sshfpr.comment }}
</td>
<td
class=
"text-right"
>
{% can_edit sshfpr %}
{% include 'buttons/edit.html' with href='machines:edit-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% can_delete sshfpr %}
{% include 'buttons/suppr.html' with href='machines:del-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='sshfingerprint' id=sshfpr.id
%}
<td
class=
"text-right"
>
{% can_edit sshfpr %}
{% include 'buttons/edit.html' with href='machines:edit-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% can_delete sshfpr %}
{% include 'buttons/suppr.html' with href='machines:del-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% history_button sshfpr
%}
</td>
</tr>
{% endfor %}
...
...
machines/templates/machines/aff_sshfpralgo.html
View file @
5dce3629
...
...
@@ -21,27 +21,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Nom de l'algo
</th>
<th></th>
</tr>
</thead>
{% for sshfpralgo in sshfpralgo_list %}
<table
class=
"table table-striped"
>
<thead>
<tr>
<td>
{{ sshfpralgo.name }}
</td>
<td
class=
"text-right"
>
{% can_edit sshfpralgo %}
{% include 'buttons/edit.html' with href='machines:edit-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% can_delete sshfpralgo %}
{% include 'buttons/suppr.html' with href='machines:del-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='sshfpralgo' id=sshfpralgo.id %}
</td>
<th>
Algorithm name
</th>
<th></th>
</tr>
{% endfor %}
</table>
</thead>
{% for sshfpralgo in sshfpralgo_list %}
<tr>
<td>
{{ sshfpralgo.name }}
</td>
<td
class=
"text-right"
>
{% can_edit sshfpralgo %}
{% include 'buttons/edit.html' with href='machines:edit-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% can_delete sshfpralgo %}
{% include 'buttons/suppr.html' with href='machines:del-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% history_button sshfpralgo %}
</td>
</tr>
{% endfor %}
</table>
machines/templates/machines/index_sshfingerprint.html
View file @
5dce3629
...
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Machines{% endblock %}
{% block content %}
<h2>
Liste des fingerprint ssh
</h2>
{% can_create SshFingerprint machine_id %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfingerprint' machine_id %}"
><i
class=
"fa fa-plus"
></i>
Ajouter une fingerprint ssh
</a>
{% acl_end %}
{% include "machines/aff_sshfingerprint.html" with sshfingerprint_list=sshfingerprint_list %}
<br
/>
<br
/>
<br
/>
<h2>
SSH fingerprints
</h2>
{% can_create SshFingerprint machine_id %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfingerprint' machine_id %}"
>
<i
class=
"fa fa-plus"
></i>
Add an SSH fingerprint
</a>
{% acl_end %}
{% include "machines/aff_sshfingerprint.html" with sshfingerprint_list=sshfingerprint_list %}
{% endblock %}
machines/templates/machines/index_sshfpralgo.html
View file @
5dce3629
...
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Machines{% endblock %}
{% block content %}
<h2>
Liste des algo fingerprint ssh
</h2>
{% can_create SshFprAlgo %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfpralgo' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter un algo ssh
</a>
{% acl_end %}
{% include "machines/aff_sshfpralgo.html" with sshfpralgo_list=sshfpralgo_list %}
<br
/>
<br
/>
<br
/>
<h2>
SSH fingerprint algorithms
</h2>
{% can_create SshFprAlgo %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfpralgo' %}"
>
<i
class=
"fa fa-plus"
></i>
Add an SSH fingerprint algorithm
</a>
{% acl_end %}
{% include "machines/aff_sshfpralgo.html" with sshfpralgo_list=sshfpralgo_list %}
{% endblock %}
machines/templates/machines/machine.html
View file @
5dce3629
...
...
@@ -33,6 +33,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if machineform %}
{% bootstrap_form_errors machineform %}
{% endif %}
{% if sshfingerprintform %}
{% bootstrap_form_errors sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
{% bootstrap_form_errors sshfpralgoform %}
{% endif %}
{% if interfaceform %}
{% bootstrap_form_errors interfaceform %}
{% endif %}
...
...
@@ -78,15 +84,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if ipv6form %}
{% bootstrap_form_errors ipv6form %}
{% endif %}
{% if sshfingerprintform %}
{% bootstrap_form_errors sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
{% bootstrap_form_errors sshfpralgoform %}
{% endif %}
<form
class=
"form"
method=
"post"
>
{% csrf_token %}
...
...
@@ -94,6 +91,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h3>
Machine
</h3>
{% massive_bootstrap_form machineform 'user' %}
{% endif %}
{% if sshfingerprintform %}
<h3>
SSH fingerprint
</h3>
{% bootstrap_form sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
<h3>
SSH fingerprint algorithm
</h3>
{% bootstrap_form sshfpralgoform %}
{% endif %}
{% if interfaceform %}
<h3>
Interface
</h3>
{% if i_mbf_param %}
...
...
@@ -162,14 +167,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h3>
Ipv6
</h3>
{% bootstrap_form ipv6form %}
{% endif %}
{% if sshfingerprintform %}
<h3>
SshFingerprint
</h3>
{% bootstrap_form sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
<h3>
Algorithme de fingerprint ssh
</h3>
{% bootstrap_form sshfpralgoform %}
{% endif %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
<br
/>
...
...
machines/templates/machines/sidebar.html
View file @
5dce3629
...
...
@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_view_all SshFprAlgo %}
<a
class=
"list-group-item list-group-item-info"
href=
"{% url "
machines:index-sshfpralgo
"
%}"
>
<i
class=
"fa fa-list-ul"
></i>
Algo de fingerprint ssh
SSH fingerprint algorithm
</a>
{% acl_end %}
{% can_view_all IpType %}
...
...
machines/views.py
View file @
5dce3629
...
...
@@ -468,7 +468,7 @@ def del_ipv6list(request, ipv6list, **_kwargs):
@
can_create
(
SshFingerprint
)
@
can_edit
(
Machine
)
def
new_sshfingerprint
(
request
,
machine
,
**
_kwargs
):
"""
Nouvelle ssh
fingerprint"""
"""
Creates an SSH
fingerprint"""
sshfingerprint_instance
=
SshFingerprint
(
machine
=
machine
)
sshfingerprint
=
SshFingerprintForm
(
request
.
POST
or
None
,
...
...
@@ -476,13 +476,13 @@ def new_sshfingerprint(request, machine, **_kwargs):
)
if
sshfingerprint
.
is_valid
():
sshfingerprint
.
save
()
messages
.
success
(
request
,
"
Fingerprint ssh ajoutée
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was added
"
)
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
machine
.
id
)}
))
return
form
(
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Cr
éer
'
},
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Cr
eate
'
},
'machines/machine.html'
,
request
)
...
...
@@ -491,7 +491,7 @@ def new_sshfingerprint(request, machine, **_kwargs):
@
login_required
@
can_edit
(
SshFingerprint
)
def
edit_sshfingerprint
(
request
,
sshfingerprint_instance
,
**
_kwargs
):
"""Edit
ion d'une ssh
fingerprint"""
"""Edit
s an SSH
fingerprint"""
sshfingerprint
=
SshFingerprintForm
(
request
.
POST
or
None
,
instance
=
sshfingerprint_instance
...
...
@@ -499,13 +499,13 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
if
sshfingerprint
.
is_valid
():
if
sshfingerprint
.
changed_data
:
sshfingerprint
.
save
()
messages
.
success
(
request
,
"
Ssh fingerprint modifiée
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was edited
"
)
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
sshfingerprint_instance
.
machine
.
id
)}
))
return
form
(
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Edit
er
'
},
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Edit'
},
'machines/machine.html'
,
request
)
...
...
@@ -514,11 +514,11 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
@
login_required
@
can_delete
(
SshFingerprint
)
def
del_sshfingerprint
(
request
,
sshfingerprint
,
**
_kwargs
):
"""
Supprime une ssh
fingerprint"""
"""
Deletes an SSH
fingerprint"""
if
request
.
method
==
"POST"
:
machineid
=
sshfingerprint
.
machine
.
id
sshfingerprint
.
delete
()
messages
.
success
(
request
,
"
La sshfingerprint a été détruite
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was deleted
"
)
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
machineid
)}
...
...
@@ -533,18 +533,18 @@ def del_sshfingerprint(request, sshfingerprint, **_kwargs):
@
login_required
@
can_create
(
SshFprAlgo
)
def
new_sshfpralgo
(
request
,
**
_kwargs
):
"""
Nouvelle sshfpralgo
"""
"""
Creates an SSH fingeprint algorithm
"""
sshfpralgo
=
SshFprAlgoForm
(
request
.
POST
or
None
,
)
if
sshfpralgo
.
is_valid
():
sshfpralgo
.
save
()
messages
.
success
(
request
,
"
Algo Fingerprint ssh ajouté
"
)
messages
.
success
(
request
,
"
The SSH fingerprint algorithm was added
"
)
return
redirect
(
reverse
(
'machines:index-sshfpralgo'
))
return
form
(
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Cr
éer
'
},
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Cr
eate
'
},
'machines/machine.html'
,
request
)
...
...
@@ -553,7 +553,7 @@ def new_sshfpralgo(request, **_kwargs):
@
login_required
@
can_edit
(
SshFprAlgo
)
def
edit_sshfpralgo
(
request
,
sshfpralgo_instance
,
**
_kwargs
):
"""Edit
ion d'une sshfpralgo
"""
"""Edit
s an SSH fingerprint algorithm
"""
sshfpralgo
=
SshFprAlgoForm
(
request
.
POST
or
None
,
instance
=
sshfpralgo_instance
...
...
@@ -561,12 +561,12 @@ def edit_sshfpralgo(request, sshfpralgo_instance, **_kwargs):
if
sshfpralgo
.
is_valid
():
if
sshfpralgo
.
changed_data
:
sshfpralgo
.
save
()
messages
.
success
(
request
,
"
Algo de sshfp modifiée
"
)
messages
.
success
(
request
,
"
The SSH fingerprint algorithm was edited
"
)
return
redirect
(
reverse
(
'machines:index-sshfpralgo'
))
return
form
(
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Edit
er
'
},
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Edit'
},
'machines/machine.html'
,
request
)
...
...
@@ -575,16 +575,16 @@ def edit_sshfpralgo(request, sshfpralgo_instance, **_kwargs):
@
login_required
@
can_delete
(
SshFprAlgo
)
def
del_sshfpralgo
(
request
,
sshfpralgo
,
**
_kwargs
):
"""
Supprime une sshfpralgo
"""
"""
Deletes an SSH fingerprint algorithm
"""
if
request
.
method
==
"POST"
:
try
:
sshfpralgo
.
delete
()
messages
.
success
(
request
,
"
La sshfpralgo a été détruite
"
)
messages
.
success
(
request
,
"
The SSH fingerprint algorithm was deleted
"
)
except
ProtectedError
:
messages
.
error
(
request
,
(
"
L'algo est affectée à au moins une fingerprint ssh,
"
"vous ne pouvez pas le supprimer
"
)
(
"
This SSH fingerprint algorithm is used by at least one SSH
"
"fingerprint and thus can not be deleted.
"
)
)
return
redirect
(
reverse
(
'machines:index-sshfpralgo'
...
...
@@ -1524,9 +1524,9 @@ def index_alias(request, interface, interfaceid):
@
login_required
@
can_
edit
(
Machine
)
@
can_
view_all
(
Machine
)
def
index_sshfingerprint
(
request
,
machine
,
machineid
):
"""
View used to display the list of existing IPv6 of an interface
"""
"""
View used to display the list of existing SSH fingerprint of a machine
"""
sshfingerprint_list
=
SshFingerprint
.
objects
.
filter
(
machine
=
machine
)
return
render
(
request
,
...
...
@@ -1538,7 +1538,7 @@ def index_sshfingerprint(request, machine, machineid):
@
login_required
@
can_view_all
(
SshFprAlgo
)
def
index_sshfpralgo
(
request
):
"""
View used to display the list of existing sshfrpalgo
"""
"""
View used to display the list of existing SSH fingerprint algorithm
"""
sshfpralgo_list
=
SshFprAlgo
.
objects
.
all
()
return
render
(
request
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment