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

topowiz: remove block mask from topology json file. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions topowiz/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ class AddNetworkForm(FlaskForm):
[validators.required()])
net_name = StringField('User friendly name of network:',
[validators.required()])
block_mask = IntegerField('Block mask size:',
default=29,
validators=[
validators.required(),
validators.NumberRange(
message="Should be between 16 and 32",
min=16, max=32)
])
submit = SubmitField(label='Submit')

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -574,12 +566,9 @@ def gen_networks(raw_conf):
if form.validate_on_submit():
cidr = form.net_cidr.data
name = form.net_name.data
# block_mask = form.block_mask.data
conf["networks"].append({
"cidr" : cidr,
"name" : name,
# Not even showing it in user config
# "block_mask" : block_mask
})
return redirect(url_for('.gen_more_networks',
raw_conf=conf_to_url(conf)))
Expand All @@ -599,6 +588,7 @@ def gen_networks(raw_conf):
action=url_for('.gen_networks',
raw_conf=raw_conf))


@app.route('/gen/more_nets/<path:raw_conf>', methods=['GET', 'POST'])
def gen_more_networks(raw_conf):
"""
Expand Down
2 changes: 1 addition & 1 deletion topowiz/templates/add_network.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<table>

{% for field in form %}
{% if field != form.csrf_token and field != form.submit and field != form.finalize and field != form.add_more and field != form.block_mask %}
{% if field != form.csrf_token and field != form.submit and field != form.finalize and field != form.add_more %}
{% if field.errors %}
<tr>
<td colspan=2>
Expand Down
3 changes: 0 additions & 3 deletions topowiz/topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ def build_topology(conf):
topo = {"networks": [], "topologies" : []}
for n in conf['networks']:
net = copy(n)
# If block mask wasn't defined, we add a default value for it
if "block_mask" not in net:
net["block_mask"] = 29
topo["networks"].append(net)

if conf.get('aws'):
Expand Down