Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
slapos
Commits
7f469d08
Commit
7f469d08
authored
May 26, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NBD server instantiation recipe.
parent
732d0f94
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
175 additions
and
0 deletions
+175
-0
slapos/slapos.recipe.nbdserver/CHANGES.txt
slapos/slapos.recipe.nbdserver/CHANGES.txt
+34
-0
slapos/slapos.recipe.nbdserver/MANIFEST.in
slapos/slapos.recipe.nbdserver/MANIFEST.in
+2
-0
slapos/slapos.recipe.nbdserver/README.txt
slapos/slapos.recipe.nbdserver/README.txt
+0
-0
slapos/slapos.recipe.nbdserver/setup.py
slapos/slapos.recipe.nbdserver/setup.py
+35
-0
slapos/slapos.recipe.nbdserver/src/slapos/__init__.py
slapos/slapos.recipe.nbdserver/src/slapos/__init__.py
+6
-0
slapos/slapos.recipe.nbdserver/src/slapos/recipe/__init__.py
slapos/slapos.recipe.nbdserver/src/slapos/recipe/__init__.py
+6
-0
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/__init__.py
....recipe.nbdserver/src/slapos/recipe/nbdserver/__init__.py
+82
-0
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/template/nbdserver_run.in
...ver/src/slapos/recipe/nbdserver/template/nbdserver_run.in
+6
-0
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/template/onetimeupload_run.in
...src/slapos/recipe/nbdserver/template/onetimeupload_run.in
+4
-0
No files found.
slapos/slapos.recipe.nbdserver/CHANGES.txt
0 → 100644
View file @
7f469d08
Changelog
=========
1.1 (unreleased)
----------------
1.0.12 (2011/01/24)
-------------------
- Allow more than 1 connection
1.0.11 (2011/01/18)
-------------------
- Updated recipe to the new BaseSlapRecipe.py
[Davide Tammaro]
1.0.10 (2011/01/06)
-------------------
- Get IPV6 address
1.0.9 (2010/11/24)
------------------
- Fix kvm command line syntax
[Romain Courteaud]
1.0.8 (2010/11/10)
------------------
- Initial version
[Romain Courteaud]
slapos/slapos.recipe.nbdserver/MANIFEST.in
0 → 100644
View file @
7f469d08
include CHANGES.txt
recursive-include src/slapos/recipe/nbdserver *.in
slapos/slapos.recipe.nbdserver/README.txt
0 → 100644
View file @
7f469d08
slapos/slapos.recipe.nbdserver/setup.py
0 → 100644
View file @
7f469d08
from
setuptools
import
setup
,
find_packages
name
=
"slapos.recipe.nbdserver"
version
=
'1.2-dev'
def
read
(
name
):
return
open
(
name
).
read
()
long_description
=
(
read
(
'README.txt'
)
+
'
\
n
'
+
read
(
'CHANGES.txt'
)
)
setup
(
name
=
name
,
version
=
version
,
description
=
"ZC Buildout recipe for create an nbd server "
,
long_description
=
long_description
,
license
=
'GPLv3'
,
keywords
=
"buildout nbd server"
,
classifiers
=
[
"Framework :: Buildout :: Recipe"
,
"Programming Language :: Python"
,
],
packages
=
find_packages
(
'src'
),
package_dir
=
{
''
:
'src'
},
include_package_data
=
True
,
install_requires
=
[
'zc.recipe.egg'
,
'setuptools'
,
'slapos.lib.recipe'
,
],
namespace_packages
=
[
'slapos'
,
'slapos.recipe'
],
entry_points
=
{
'zc.buildout'
:
[
'default = %s:Recipe'
%
name
]},
)
slapos/slapos.recipe.nbdserver/src/slapos/__init__.py
0 → 100644
View file @
7f469d08
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
slapos/slapos.recipe.nbdserver/src/slapos/recipe/__init__.py
0 → 100644
View file @
7f469d08
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/__init__.py
0 → 100644
View file @
7f469d08
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
binascii
from
slapos.lib.recipe.BaseSlapRecipe
import
BaseSlapRecipe
import
pkg_resources
class
Recipe
(
BaseSlapRecipe
):
def
_install
(
self
):
# Image path
cdrom_iso
=
os
.
path
.
join
(
self
.
data_root_directory
,
'cdrom.iso'
)
#Get the IP list
ip
=
self
.
getGlobalIPv6Address
()
http_port
=
9999
nbd_port
=
1024
# Instanciate onetimeupload
onetimeupload_config
=
{}
onetimeupload_config
.
update
(
self
.
options
)
onetimeupload_config
[
'port'
]
=
http_port
onetimeupload_config
[
'ip'
]
=
ip
onetimeupload_config
[
'image'
]
=
cdrom_iso
onetimeupload_config
[
'key'
]
=
binascii
.
hexlify
(
os
.
urandom
(
24
))
onetimeupload_config
[
'log_path'
]
=
os
.
path
.
join
(
self
.
log_directory
,
'onetimeupload.log'
)
wrapper_template_location
=
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'template'
,
'onetimeupload_run.in'
))
onetimeupload_runner_path
=
self
.
createRunningWrapper
(
"onetimeupload"
,
self
.
substituteTemplate
(
wrapper_template_location
,
onetimeupload_config
))
# Instanciate qemu
qemu_config
=
{}
qemu_config
.
update
(
self
.
options
)
qemu_config
[
'ip'
]
=
ip
qemu_config
[
'port'
]
=
nbd_port
qemu_config
[
'image'
]
=
cdrom_iso
wrapper_template_location
=
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'template'
,
'nbdserver_run.in'
))
nbdserver_runner_path
=
self
.
createRunningWrapper
(
"nbdserver"
,
self
.
substituteTemplate
(
wrapper_template_location
,
qemu_config
))
# Publish connection dict
self
.
computer_partition
.
setConnectionDict
(
dict
(
upload_connection_string
=
"https://[%s]:%s/"
%
(
ip
,
http_port
),
upload_key
=
onetimeupload_config
[
'key'
],
nbd_connection_string
=
"nbd:[%s]:%s"
%
(
ip
,
nbd_port
),
))
return
[
onetimeupload_runner_path
,
nbdserver_runner_path
]
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/template/nbdserver_run.in
0 → 100644
View file @
7f469d08
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
# 32767 is the maximum number of connections allowed by the nbd server
exec
%
(
qemu_path
)
s
-b
%
(
ip
)
s %
(
image
)
s
-r
-t
-p
%
(
port
)
s
-e
32767
slapos/slapos.recipe.nbdserver/src/slapos/recipe/nbdserver/template/onetimeupload_run.in
0 → 100644
View file @
7f469d08
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec
%
(
onetimeupload_path
)
s
-l
%
(
log_path
)
s %
(
ip
)
s %
(
port
)
s %
(
image
)
s %
(
key
)
s
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