Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
router_services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nova
router_services
Commits
73b2797f
Commit
73b2797f
authored
Dec 03, 2013
by
Sigmund Augdal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read settings from a config file, so we don't have to have passwords in the repository
parent
471ce814
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
clean_stale.py
clean_stale.py
+10
-9
No files found.
clean_stale.py
View file @
73b2797f
...
...
@@ -4,20 +4,21 @@ import etcd
from
nova_router
import
neighbors
from
scvmm_client
import
odata
import
logging
try
:
from
configparser
import
SafeConfigParser
except
ImportError
:
from
ConfigParser
import
SafeConfigParser
def
main
():
key
=
"/home/sigmunda/Devel/nova/etcd_client.key"
cert
=
"/home/sigmunda/Devel/nova/etcd_client.crt"
cacert
=
"/home/sigmunda/Devel/nova/etcd_ca.crt"
vmm_baseurl
=
'https://srv-spf-99.bs.unsi.no:8090/SC2012R2/VMM/Microsoft.Management.Odata.svc'
username
=
'bs-unsi\spfsvc'
password
=
'Laste8il'
conf
=
SafeConfigParser
()
conf
.
read
(
"nova.cfg"
)
logging
.
basicConfig
(
level
=
logging
.
INFO
,
format
=
'%(asctime)s %(name)s %(levelname)s %(message)s'
)
etcd_client
=
etcd
.
Etcd
(
"158.38.213.2"
,
ssl_key
=
key
,
ssl_cert
=
cert
,
verify
=
cacert
)
vmm_client
=
odata
.
VMMClient
(
vmm_baseurl
,
username
,
password
)
etcd_client
=
etcd
.
Etcd
(
"158.38.213.2"
,
ssl_key
=
conf
.
get
(
'etcd'
,
'key'
),
ssl_cert
=
conf
.
get
(
'etcd'
,
'cert'
),
verify
=
conf
.
get
(
'etcd'
,
'cacert'
))
vmm_client
=
odata
.
VMMClient
(
conf
.
get
(
'spf'
,
'vmm_baseurl'
),
conf
.
get
(
'spf'
,
'username'
),
conf
.
get
(
'spf'
,
'password'
))
nics
=
set
()
for
nic
in
vmm_client
.
query_collection
(
"VirtualNetworkAdapters"
):
...
...
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