cc1
v2.1
CC1 source code docs
Main Page
Related Pages
Packages
Classes
Files
File List
cc1
Todo List
Packages
Classes
Files
File List
clm
cm
common
tools
__init__.py
apache.py
config.py
db_psql.py
system.py
__init__.py
hardware.py
signature.py
states.py
utils.py
ec2
node
vmm
wi
__init__.py
manage.py
sitecustomize.py
wi_tests_manage.py
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
db_psql.py
Go to the documentation of this file.
1
import
subprocess
2
3
def
create
(config, site):
4
if
'HOST'
not
in
config.DATABASES[
'default'
]:
5
subprocess.call([
'su'
,
'postgres'
,
'-c'
,
"psql -c \"CREATE USER cc1;\""
])
6
subprocess.call([
'su'
,
'postgres'
,
'-c'
,
"psql -c \"CREATE DATABASE %s WITH OWNER cc1;\""
% site])
7
return
0
8
9
def
remove
(config, site):
10
if
'HOST'
not
in
config.DATABASES[
'default'
]:
11
subprocess.call([
'su'
,
'postgres'
,
'-c'
,
"psql -c \"REVOKE ALL PRIVILEGES ON DATABASE %s FROM cc1;\""
% site])
12
return
0
13
14
def
purge
(config, site):
15
remove
()
16
subprocess.call([
'su'
,
'postgres'
,
'-c'
,
"psql -c \"DROP DATABASE %s;\""
% site])
17
return
0
18
common
tools
db_psql.py
Generated on Wed Jun 18 2014 13:33:05 for cc1 by
1.8.1.2