Skip to content

Commit

Permalink
Fixes for various update fednet bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tinova committed Dec 22, 2016
1 parent 2e81730 commit 755948b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ $ bundle install
The server can be invoked using the bin/federatedsdn-server script. Before the
first execution check config/federatedsdn-server.conf to adjust configuration.

$ bin/federatedsdn-server start
$ cd bin && ./federatedsdn-server start

And stopped:

$ bin/federatedsdn-server stop
$ cd bin && ./federatedsdn-server stop

## Client Tools

Expand Down
10 changes: 5 additions & 5 deletions client/examples/tenant.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"password": "secret",
"type": "user",
"valid_sites": [
{
"site_id" : "1",
"user_id_in_site": "0",
"credentials": "oneadmin:opennebula"
}
{
"site_id" : "1",
"user_id_in_site": "0",
"credentials": "oneadmin:opennebula"
}
]
}
2 changes: 1 addition & 1 deletion controllers/federatedsdn-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def is_admin
st, result = fednet_pool.update(params[:id],
@username,
is_admin,
Parser.parse_body(request)[0])
Parser.parse_body(request))
build_response(st, result)
end

Expand Down
4 changes: 2 additions & 2 deletions models/fednet_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def update(id, username, is_admin, new_fednet)
net_array_element = Hash.new
net_array_element[:name] = ns[:name]
net_array_element[:vnid] = ns[:cmp_net_id]
net_array_element[:site] = FederatedSDN::SitePool.new().get(ns[:site_id]).name
net_array_element[:tenant_id] = FederatedSDN::TenantPool.new().get_tenant_id_in_site(owner, net_array_element[:site])
net_array_element[:site] = FederatedSDN::SitePool.new().get(ns[:site_id])[1][:name]
net_array_element[:tenant_id] = FederatedSDN::TenantPool.new().get_tenant_id_in_site(username, FederatedSDN::SitePool.new().get(ns[:site_id])[1][:id])
net_array_element[:cmp_blob] = ns[:cmp_blob]

net_array << net_array_element
Expand Down
2 changes: 1 addition & 1 deletion models/tenant_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def is_admin(username)

def get_tenant_id_in_site(username, site)
tenant_id = @table.filter(:name => username).first[:id]
@table_to_site.filter(:tenant_id => tenant_id).filter(:site_id => site_id).first[:user_id_in_site]
@table_to_site.filter(:tenant_id => tenant_id).filter(:site_id => site).first[:user_id_in_site]
end

def validate_user(site_type, cmp_endpoint, username, password)
Expand Down

0 comments on commit 755948b

Please sign in to comment.