Permalink
Browse files

Cleanup, add deps for git based ebuild only

  • Loading branch information...
1 parent 609085a commit 50421a941a560bd9e793a55b02d88396394679e8 @ramereth committed Apr 23, 2011
@@ -2,5 +2,5 @@ AUX ganeti-2.1.initd 2014 RMD160 44996bf7d50b8ac70df572daafa5f5d04be021a8 SHA1 c
AUX ganeti-kvm-poweroff.confd 186 RMD160 87242c3c785e012b2ec7534836dabd8017a25893 SHA1 955bdc02481591c06d8e00f1b6e04c55830e1150 SHA256 d811f1825351b03653aed4b6827b2b0c9dd1dc3340c980862c0758b3bf5ad21e
AUX ganeti-kvm-poweroff.initd 1621 RMD160 2d8d59ac9bf25ff6efa74a3277f4d295c05d4282 SHA1 7e3cbfb9f6ed988393522af6569a96c66cb4feb0 SHA256 bb7b6ab5ac2899969bab52d9c5e1c5d9fd9629d247563ff74e8b9f64a4478e28
AUX ganeti.confd 248 RMD160 18662964365f102e77f593429bb0772d94c65267 SHA1 337999b3fbeb64518f3d39c41634e3f414aedb25 SHA256 7efc3a5052ad5c2085605a8c0bf9e9bb9cf20c0623263b7abcd0b7a0cb9a895b
-EBUILD ganeti-9999.ebuild 3033 RMD160 5aa1eb441939ccb269c568d2cc224cfc15a08a76 SHA1 17855550e894bcd5c8e8fb4d3121122692de9789 SHA256 3471f196ab2222748069e2a90dcfdc23a86a0bd048052e1da126900ae24a87bb
+EBUILD ganeti-9999.ebuild 3277 RMD160 7a8c40922f615a3e4160a0fc748afb0ff95f9b3d SHA1 6c0366f0d803f2251c057daa59bd086a3e65f191 SHA256 c56201fc1929d0e09581bd2015adfbcbef3ce090ff073a0f51d2bd86e3ee41c9
MISC metadata.xml 1358 RMD160 de8bee91dc78ae852b91c222c33dbd99a39a2aea SHA1 0deb8c56fbc86e544ed75208628f35b8b01ff84b SHA256 618c02b7f5deeb9c1d15c261eaffcf62d295fe5d192731045f007fa7b65fcc36
@@ -1,78 +0,0 @@
-commit e4d1b9772202473dd0219c157299336ad8845ecb
-Author: Lance Albertson <lance@osuosl.org>
-Date: Fri Sep 3 14:11:40 2010 -0700
-
- Allow KVM to boot from HTTP
-
- New versions of KVM support booting from HTTP-hosted ISO images, via libcurl.
- This patch adds a proper check to allow defining either a sane, absolute path
- or an HTTP URL as an iso image path.
-
-diff --git a/lib/hypervisor/hv_base.py b/lib/hypervisor/hv_base.py
-index 80675ee..cd4ad99 100644
---- a/lib/hypervisor/hv_base.py
-+++ b/lib/hypervisor/hv_base.py
-@@ -62,6 +62,12 @@ def _IsCpuMaskWellFormed(cpu_mask):
- _FILE_CHECK = (utils.IsNormAbsPath, "must be an absolute normalized path",
- os.path.isfile, "not found or not a file")
-
-+# must be a file or an HTTP URL
-+_FILE_OR_URL_CHECK = (utils.IsNormAbsPathOrURL,
-+ "must be an absolute normalized path or an HTTP URL",
-+ lambda x: os.path.isfile(x) or x.startswith('http://'),
-+ "not found or not a file or URL")
-+
- # must be a directory
- _DIR_CHECK = (utils.IsNormAbsPath, "must be an absolute normalized path",
- os.path.isdir, "not found or not a directory")
-@@ -75,6 +81,8 @@ _CPU_MASK_CHECK = (_IsCpuMaskWellFormed,
- # nice wrappers for users
- REQ_FILE_CHECK = (True, ) + _FILE_CHECK
- OPT_FILE_CHECK = (False, ) + _FILE_CHECK
-+REQ_FILE_OR_URL_CHECK = (True, ) + _FILE_OR_URL_CHECK
-+OPT_FILE_OR_URL_CHECK = (False, ) + _FILE_OR_URL_CHECK
- REQ_DIR_CHECK = (True, ) + _DIR_CHECK
- OPT_DIR_CHECK = (False, ) + _DIR_CHECK
- NET_PORT_CHECK = (True, lambda x: x > 0 and x < 65535, "invalid port number",
-diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
-index c849dba..1ff8890 100644
---- a/lib/hypervisor/hv_kvm.py
-+++ b/lib/hypervisor/hv_kvm.py
-@@ -182,7 +182,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
- constants.HV_VNC_X509: hv_base.OPT_DIR_CHECK,
- constants.HV_VNC_X509_VERIFY: hv_base.NO_CHECK,
- constants.HV_VNC_PASSWORD_FILE: hv_base.OPT_FILE_CHECK,
-- constants.HV_CDROM_IMAGE_PATH: hv_base.OPT_FILE_CHECK,
-+ constants.HV_CDROM_IMAGE_PATH: hv_base.OPT_FILE_OR_URL_CHECK,
- constants.HV_BOOT_ORDER:
- hv_base.ParamInSet(True, constants.HT_KVM_VALID_BO_TYPES),
- constants.HV_NIC_TYPE:
-@@ -539,7 +539,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
-
- iso_image = hvp[constants.HV_CDROM_IMAGE_PATH]
- if iso_image:
-- options = ',format=raw,media=cdrom'
-+ options = ',media=cdrom'
-+ if not iso_image.startswith('http://'):
-+ options = "%s,format=raw" % options
- if boot_cdrom:
- kvm_cmd.extend(['-boot', 'd'])
- if disk_type != constants.HT_DISK_IDE:
-diff --git a/lib/utils.py b/lib/utils.py
-index 441e5bb..41cb0fe 100644
---- a/lib/utils.py
-+++ b/lib/utils.py
-@@ -2562,6 +2562,13 @@ def PathJoin(*args):
- " (%s != %s)" % (prefix, root))
- return result
-
-+def IsNormAbsPathOrURL(path):
-+ """Check whether a path is absolute and normalized, or
-+ an HTTP URL.
-+
-+ """
-+ return IsNormAbsPath(path) or path.startswith('http://')
-+
-
- def TailFile(fname, lines=20):
- """Return the last lines from a file.
@@ -1,234 +0,0 @@
-commit b176f9f4c00eade2ca30d0e24f7f010d9eefec8f
-Author: Lance Albertson <lance@osuosl.org>
-Date: Fri Sep 3 14:05:03 2010 -0700
-
- Implemented vnc random password generation for KVM
-
- Added OpCode, Logical unit, and remote api calls to randomize the VNC password
- for KVM. This can be used for providing one-time access to VNC sessions.
-
-diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded
-index 6774ea4..fafc841 100755
---- a/daemons/ganeti-noded
-+++ b/daemons/ganeti-noded
-@@ -583,6 +583,14 @@ class NodeHttpServer(http.server.HttpServer):
- """
- return backend.GetInstanceList(params[0])
-
-+ @staticmethod
-+ def perspective_instance_set_random_vnc_password(params):
-+ """Set a random vnc password for the instance.
-+
-+ """
-+ instance = objects.Instance.FromDict(params[0])
-+ return backend.InstanceSetRandomVncPassword(instance)
-+
- # node --------------------------
-
- @staticmethod
-diff --git a/lib/backend.py b/lib/backend.py
-index 5b2bebd..0d7ab99 100644
---- a/lib/backend.py
-+++ b/lib/backend.py
-@@ -1188,6 +1188,21 @@ def InstanceReboot(instance, reboot_type, shutdown_timeout):
- else:
- _Fail("Invalid reboot_type received: %s", reboot_type)
-
-+def InstanceSetRandomVncPassword(instance):
-+ """Set a random VNC password for an instance
-+
-+ @type instance: L{objects.Instance}
-+ @param instance: the instance definition
-+ @rtype: dict
-+
-+ """
-+ hyper = hypervisor.GetHypervisor(instance.hypervisor)
-+ try:
-+ output = hyper.SetRandomVncPassword(instance)
-+ except errors.HypervisorError, err:
-+ _Fail("Failed to set a random password: %s", err, exc=True)
-+ return output
-+
-
- def MigrationInfo(instance):
- """Gather information about an instance to be migrated.
-diff --git a/lib/cmdlib.py b/lib/cmdlib.py
-index b453893..1f6fb0a 100644
---- a/lib/cmdlib.py
-+++ b/lib/cmdlib.py
-@@ -9258,6 +9258,47 @@ class LUSetInstanceParams(LogicalUnit):
- (constants.DT_DRBD8, constants.DT_PLAIN): _ConvertDrbdToPlain,
- }
-
-+class LUSetRandomVncPassword(NoHooksLU):
-+ """Set a random VNC password for an instance
-+
-+ """
-+ HPATH = None
-+ HTYPE = None
-+ _OP_REQP = ["instance_name"]
-+ REQ_BGL = False
-+
-+ def CheckArguments(self):
-+ """Check the arguments.
-+
-+ """
-+ pass
-+
-+ def ExpandNames(self):
-+ self._ExpandAndLockInstance()
-+
-+ def CheckPrereq(self):
-+ """Check prerequisites.
-+
-+ This checks that the instance is in the cluster.
-+
-+ """
-+ self.instance = self.cfg.GetInstanceInfo(self.op.instance_name)
-+ assert self.instance is not None, \
-+ "Cannot retrieve locked instance %s" % self.op.instance_name
-+ _CheckNodeOnline(self, self.instance.primary_node)
-+
-+ def Exec(self, feedback_fn):
-+ """Randomize the vnc password
-+
-+ """
-+ instance = self.instance
-+ node_current = instance.primary_node
-+ result = self.rpc.call_instance_set_random_vnc_password(node_current, instance)
-+ msg = result.fail_msg
-+ if msg:
-+ self.proc.LogWarning("Failed to set password: %s" % msg)
-+
-+ return result.data[1]
-
- class LUQueryExports(NoHooksLU):
- """Query the exports list
-diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
-index c849dba..10fdf17 100644
---- a/lib/hypervisor/hv_kvm.py
-+++ b/lib/hypervisor/hv_kvm.py
-@@ -30,8 +30,10 @@ import re
- import tempfile
- import time
- import logging
-+import string
- import pwd
- from cStringIO import StringIO
-+from random import Random
-
- from ganeti import utils
- from ganeti import constants
-@@ -797,6 +799,20 @@ class KVMHypervisor(hv_base.BaseHypervisor):
- self._SaveKVMRuntime(instance, kvm_runtime)
- self._ExecuteKVMRuntime(instance, kvm_runtime)
-
-+ def SetRandomVncPassword(self, instance):
-+ """Set a random vnc password.
-+
-+ Generate and set a random VNC password for the current instance.
-+ Returns the password.
-+
-+ @rtype: str
-+
-+ """
-+ vnc_pwd = "".join(Random().sample(string.letters + string.digits, 8))
-+ change_cmd = 'change vnc password %s' % vnc_pwd
-+ self._CallMonitorCommand(instance.name, change_cmd)
-+ return vnc_pwd
-+
- def _CallMonitorCommand(self, instance_name, command):
- """Invoke a command on the instance monitor.
-
-diff --git a/lib/mcpu.py b/lib/mcpu.py
-index 4039d75..c7552d2 100644
---- a/lib/mcpu.py
-+++ b/lib/mcpu.py
-@@ -204,6 +204,7 @@ class Processor(object):
- opcodes.OpQueryInstances: cmdlib.LUQueryInstances,
- opcodes.OpQueryInstanceData: cmdlib.LUQueryInstanceData,
- opcodes.OpSetInstanceParams: cmdlib.LUSetInstanceParams,
-+ opcodes.OpSetRandomVncPassword: cmdlib.LUSetRandomVncPassword,
- opcodes.OpGrowDisk: cmdlib.LUGrowDisk,
- # os lu
- opcodes.OpDiagnoseOS: cmdlib.LUDiagnoseOS,
-diff --git a/lib/opcodes.py b/lib/opcodes.py
-index 34ed717..43edb04 100644
---- a/lib/opcodes.py
-+++ b/lib/opcodes.py
-@@ -637,6 +637,15 @@ class OpSetInstanceParams(OpCode):
- ]
-
-
-+class OpSetRandomVncPassword(OpCode):
-+ """Set a random VNC password for an instance"""
-+ OP_ID = "OP_INSTANCE_SET_RANDOM_VNC_PASSWORD"
-+ OP_DSC_FIELD = "instance_name"
-+ __slots__ = OpCode.__slots__ + [
-+ "instance_name",
-+ ]
-+
-+
- class OpGrowDisk(OpCode):
- """Grow a disk of an instance."""
- OP_ID = "OP_INSTANCE_GROW_DISK"
-diff --git a/lib/rapi/connector.py b/lib/rapi/connector.py
-index 648aa0b..1cbfe8d 100644
---- a/lib/rapi/connector.py
-+++ b/lib/rapi/connector.py
-@@ -219,6 +219,8 @@ def GetHandlers(node_name_pattern, instance_name_pattern, job_id_pattern):
- rlib2.R_2_instances_name_rename,
- re.compile(r'^/2/instances/(%s)/modify$' % instance_name_pattern):
- rlib2.R_2_instances_name_modify,
-+ re.compile(r'^/2/instances/(%s)/randomvncpass$' % instance_name_pattern):
-+ rlib2.R_2_instances_name_randomvncpass,
-
- "/2/jobs": rlib2.R_2_jobs,
- re.compile(r"^/2/jobs/(%s)$" % job_id_pattern):
-diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py
-index b7e9b9b..6606af8 100644
---- a/lib/rapi/rlib2.py
-+++ b/lib/rapi/rlib2.py
-@@ -772,6 +772,20 @@ class R_2_instances_name_info(baserlib.R_Generic):
- return baserlib.SubmitJob([op])
-
-
-+class R_2_instances_name_randomvncpass(baserlib.R_Generic):
-+ """/2/instances/[instance_name]/randomvncpass resource.
-+
-+ """
-+ def POST(self):
-+ """Request detailed instance information.
-+
-+ """
-+ instance_name = self.items[0]
-+
-+ op = opcodes.OpSetRandomVncPassword(instance_name=instance_name)
-+ return baserlib.SubmitJob([op])
-+
-+
- class R_2_instances_name_reboot(baserlib.R_Generic):
- """/2/instances/[instance_name]/reboot resource.
-
-diff --git a/lib/rpc.py b/lib/rpc.py
-index 08f69ef..c1906c0 100644
---- a/lib/rpc.py
-+++ b/lib/rpc.py
-@@ -627,6 +627,17 @@ class RpcRunner(object):
- [self._InstDict(instance), timeout])
-
- @_RpcTimeout(_TMO_NORMAL)
-+ def call_instance_set_random_vnc_password(self, node, instance):
-+ """Sets a random vnc password for an instance
-+
-+ This is a single-node call.
-+
-+ """
-+ return self._SingleNodeCall(node, "instance_set_random_vnc_password",
-+ [self._InstDict(instance)])
-+
-+
-+ @_RpcTimeout(_TMO_NORMAL)
- def call_migration_info(self, node, instance):
- """Gather the information necessary to prepare an instance migration.
-
Oops, something went wrong.

0 comments on commit 50421a9

Please sign in to comment.