-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatic merge of 'ocf' (3904717) into 'master'
> Merge 'ofelia.development' into 'ocf' (improved VM contextualisation)
- Loading branch information
1 parent
d6800f9
commit 1295ed8
Showing
12 changed files
with
970 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
vt_manager/src/python/vt_manager/utils/contextualization/fix_dependencies.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
apt_src_list=/etc/apt/sources.list | ||
etc_hosts=/etc/hosts | ||
sudoers_file=/etc/sudoers | ||
|
||
|
||
# Skip if a) sudo package is installed or b) image is not Debian 6 | ||
([[ ! -z $(dpkg | grep sudo) ]] || [[ -z $(uname -a | grep "2.6.32-5-xen") ]] ) && return 0 | ||
|
||
if [ ! -f $apt_src_list.bak ]; then | ||
sed -i 's/^/#/' $apt_src_list | ||
mv $apt_src_list $apt_src_list.bak | ||
echo """ | ||
# | ||
# Updated sources | ||
# | ||
deb http://httpredir.debian.org/debian/ wheezy main contrib non-free | ||
deb-src http://httpredir.debian.org/debian/ wheezy main contrib non-free | ||
deb http://security.debian.org/ wheezy/updates main contrib non-free | ||
deb-src http://security.debian.org/ wheezy/updates main contrib non-free | ||
deb http://httpredir.debian.org/debian wheezy-updates main contrib non-free | ||
deb-src http://httpredir.debian.org/debian wheezy-updates main contrib non-free | ||
""" > $apt_src_list | ||
fi | ||
|
||
apt-key update | ||
|
||
# Non-supported keys | ||
declare -a err_keys=("8B48AD6246925553" "9D6D8F6BC857C906" "7638D0442B90D010" "6FB2A1C265FFB764") | ||
for i in "${err_keys[@]}" | ||
do | ||
gpg --keyserver pgpkeys.mit.edu --recv-key "$i" | ||
gpg -a --export "$i" | apt-key add - | ||
done | ||
|
||
# Lack of sudo | ||
apt-get update -y | ||
|
||
mv $sudoers_file $sudoers_file.bak | ||
apt-get install sudo -y | ||
mv $sudoers_file $sudoers_file.orig | ||
mv $sudoers_file.bak $sudoers_file | ||
|
||
# Warning on sudo | ||
hostname=$(hostname) | ||
[[ -z $(grep "127.0.0.1 $hostname" $etc_hosts) ]] && echo "127.0.0.1 $hostname" >> $etc_hosts | ||
|
||
# SSH connection | ||
ifconfig eth0 mtu 1496 | ||
ifconfig eth1 mtu 1496 | ||
ifconfig eth2 mtu 1496 |
9 changes: 9 additions & 0 deletions
9
vt_manager/src/python/vt_manager/utils/contextualization/paramiko_scp/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changelog | ||
|
||
## 0.9.0 (2015-02-04) | ||
|
||
- Add changelog | ||
- Finish up py3k and unicode support | ||
- Unicode should work on OSX, Windows and Linux | ||
- Some tests have been added | ||
|
14 changes: 14 additions & 0 deletions
14
vt_manager/src/python/vt_manager/utils/contextualization/paramiko_scp/LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library 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 | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
2 changes: 2 additions & 0 deletions
2
vt_manager/src/python/vt_manager/utils/contextualization/paramiko_scp/MANIFEST.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include LICENSE.txt | ||
include README.rst |
57 changes: 57 additions & 0 deletions
57
vt_manager/src/python/vt_manager/utils/contextualization/paramiko_scp/README.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Pure python scp module | ||
====================== | ||
|
||
The scp.py module uses a paramiko transport to send and recieve files via the | ||
scp1 protocol. This is the protocol as referenced from the openssh scp program, | ||
and has only been tested with this implementation. | ||
|
||
|
||
Example | ||
------- | ||
|
||
.. code-block:: python | ||
from paramiko import SSHClient | ||
from scp import SCPClient | ||
ssh = SSHClient() | ||
ssh.load_system_host_keys() | ||
ssh.connect('example.com') | ||
# SCPCLient takes a paramiko transport as its only argument | ||
scp = SCPClient(ssh.get_transport()) | ||
scp.put('test.txt', 'test2.txt') | ||
scp.get('test2.txt') | ||
scp.close() | ||
.. code-block:: | ||
$ md5sum test.txt test2.txt | ||
fc264c65fb17b7db5237cf7ce1780769 test.txt | ||
fc264c65fb17b7db5237cf7ce1780769 test2.txt | ||
Using 'with' keyword | ||
------------------ | ||
|
||
.. code-block:: python | ||
from paramiko import SSHClient | ||
from scp import SCPClient | ||
ssh = SSHClient() | ||
ssh.load_system_host_keys() | ||
ssh.connect('example.com') | ||
with SCPClient(ssh.get_transport()) as scp: | ||
scp.put('test.txt', 'test2.txt') | ||
scp.get('test2.txt') | ||
.. code-block:: | ||
$ md5sum test.txt test2.txt | ||
fc264c65fb17b7db5237cf7ce1780769 test.txt | ||
fc264c65fb17b7db5237cf7ce1780769 test2.txt |
Empty file.
Oops, something went wrong.