Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
opennsa3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Hažlinský
opennsa3
Commits
b9c52cff
Commit
b9c52cff
authored
12 years ago
by
Henrik Thostrup Jensen
Browse files
Options
Downloads
Patches
Plain Diff
update table name for generic backend
parent
35235462
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
datafiles/schema-delete.sql
+2
-2
2 additions, 2 deletions
datafiles/schema-delete.sql
datafiles/schema.sql
+1
-1
1 addition, 1 deletion
datafiles/schema.sql
opennsa/backends/common/genericbackend.py
+11
-11
11 additions, 11 deletions
opennsa/backends/common/genericbackend.py
with
14 additions
and
14 deletions
datafiles/schema-delete.sql
+
2
−
2
View file @
b9c52cff
-- OpenNSA SQL Schema (PostgreSQL) DROPs
-- OpenNSA SQL Schema (PostgreSQL) DROPs
-- This is mainly for development
-- This is mainly for development
DROP
TABLE
simple
backendconnections
;
DROP
TABLE
generic_
backend
_
connections
;
DROP
TABLE
subconnections
;
DROP
TABLE
sub
_
connections
;
DROP
TABLE
service_connections
;
DROP
TABLE
service_connections
;
DROP
TYPE
label
;
DROP
TYPE
label
;
This diff is collapsed.
Click to expand it.
datafiles/schema.sql
+
1
−
1
View file @
b9c52cff
...
@@ -52,7 +52,7 @@ CREATE TABLE sub_connections (
...
@@ -52,7 +52,7 @@ CREATE TABLE sub_connections (
-- move this into the backend sometime
-- move this into the backend sometime
CREATE
TABLE
simple
backendconnections
(
CREATE
TABLE
generic_
backend
_
connections
(
id
serial
PRIMARY
KEY
,
id
serial
PRIMARY
KEY
,
connection_id
text
NOT
NULL
UNIQUE
,
connection_id
text
NOT
NULL
UNIQUE
,
revision
integer
NOT
NULL
,
revision
integer
NOT
NULL
,
...
...
This diff is collapsed.
Click to expand it.
opennsa/backends/common/genericbackend.py
+
11
−
11
View file @
b9c52cff
...
@@ -30,7 +30,7 @@ from twistar.dbobject import DBObject
...
@@ -30,7 +30,7 @@ from twistar.dbobject import DBObject
class
Simpleb
ackend
c
onnection
(
DBObject
):
class
GenericB
ackend
C
onnection
s
(
DBObject
):
pass
pass
...
@@ -80,7 +80,7 @@ class GenericBackend(service.Service):
...
@@ -80,7 +80,7 @@ class GenericBackend(service.Service):
@defer.inlineCallbacks
@defer.inlineCallbacks
def
buildSchedule
(
self
):
def
buildSchedule
(
self
):
conns
=
yield
Simpleb
ackend
c
onnection
.
find
(
where
=
[
'
lifecycle_state <> ?
'
,
state
.
TERMINATED
])
conns
=
yield
GenericB
ackend
C
onnection
s
.
find
(
where
=
[
'
lifecycle_state <> ?
'
,
state
.
TERMINATED
])
for
conn
in
conns
:
for
conn
in
conns
:
# avoid race with newly created connections
# avoid race with newly created connections
if
self
.
scheduler
.
hasScheduledCall
(
conn
.
connection_id
):
if
self
.
scheduler
.
hasScheduledCall
(
conn
.
connection_id
):
...
@@ -129,7 +129,7 @@ class GenericBackend(service.Service):
...
@@ -129,7 +129,7 @@ class GenericBackend(service.Service):
defer
.
returnValue
(
self
.
connection_cache
[
connection_id
])
defer
.
returnValue
(
self
.
connection_cache
[
connection_id
])
except
KeyError
:
except
KeyError
:
pass
pass
conns
=
yield
Simpleb
ackend
c
onnection
.
findBy
(
connection_id
=
connection_id
)
conns
=
yield
GenericB
ackend
C
onnection
s
.
findBy
(
connection_id
=
connection_id
)
if
len
(
conns
)
==
0
:
if
len
(
conns
)
==
0
:
raise
error
.
ConnectionNonExistentError
(
'
No connection with id %s
'
%
connection_id
)
raise
error
.
ConnectionNonExistentError
(
'
No connection with id %s
'
%
connection_id
)
self
.
connection_cache
[
connection_id
]
=
conns
[
0
]
self
.
connection_cache
[
connection_id
]
=
conns
[
0
]
...
@@ -152,7 +152,7 @@ class GenericBackend(service.Service):
...
@@ -152,7 +152,7 @@ class GenericBackend(service.Service):
if
connection_id
:
if
connection_id
:
raise
ValueError
(
'
Cannot handle cases with existing connection id (yet)
'
)
raise
ValueError
(
'
Cannot handle cases with existing connection id (yet)
'
)
#conns = yield
Simpleb
ackend
c
onnection.findBy(connection_id=connection_id)
#conns = yield
GenericB
ackend
C
onnection
s
.findBy(connection_id=connection_id)
# need to check schedule
# need to check schedule
...
@@ -228,13 +228,13 @@ class GenericBackend(service.Service):
...
@@ -228,13 +228,13 @@ class GenericBackend(service.Service):
connection_id
=
self
.
connection_manager
.
createConnectionId
(
source_target
,
dest_target
)
connection_id
=
self
.
connection_manager
.
createConnectionId
(
source_target
,
dest_target
)
# should we save the requester or provider here?
# should we save the requester or provider here?
conn
=
Simpleb
ackend
c
onnection
(
connection_id
=
connection_id
,
revision
=
0
,
global_reservation_id
=
global_reservation_id
,
description
=
description
,
conn
=
GenericB
ackend
C
onnection
s
(
connection_id
=
connection_id
,
revision
=
0
,
global_reservation_id
=
global_reservation_id
,
description
=
description
,
requester_nsa
=
requester_nsa
.
urn
(),
reserve_time
=
now
,
requester_nsa
=
requester_nsa
.
urn
(),
reserve_time
=
now
,
reservation_state
=
state
.
INITIAL
,
provision_state
=
state
.
SCHEDULED
,
activation_state
=
state
.
INACTIVE
,
lifecycle_state
=
state
.
INITIAL
,
reservation_state
=
state
.
INITIAL
,
provision_state
=
state
.
SCHEDULED
,
activation_state
=
state
.
INACTIVE
,
lifecycle_state
=
state
.
INITIAL
,
source_network
=
source_stp
.
network
,
source_port
=
source_stp
.
port
,
source_labels
=
[
src_label
],
source_network
=
source_stp
.
network
,
source_port
=
source_stp
.
port
,
source_labels
=
[
src_label
],
dest_network
=
dest_stp
.
network
,
dest_port
=
dest_stp
.
port
,
dest_labels
=
[
dst_label
],
dest_network
=
dest_stp
.
network
,
dest_port
=
dest_stp
.
port
,
dest_labels
=
[
dst_label
],
start_time
=
service_params
.
start_time
,
end_time
=
service_params
.
end_time
,
start_time
=
service_params
.
start_time
,
end_time
=
service_params
.
end_time
,
bandwidth
=
service_params
.
bandwidth
)
bandwidth
=
service_params
.
bandwidth
)
yield
conn
.
save
()
yield
conn
.
save
()
# this sould really be much earlier, need to save connection before checking
# this sould really be much earlier, need to save connection before checking
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment