Преглед на файлове

A couple of updates missed in the previous two commits... + docs

Enis Afgan преди 9 години
родител
ревизия
456634b7ca
променени са 3 файла, в които са добавени 11 реда и са изтрити 27 реда
  1. 3 3
      .travis.yml
  2. 3 20
      cloudbridge/cloud/providers/openstack/resources.py
  3. 5 4
      docs/topics/launch.rst

+ 3 - 3
.travis.yml

@@ -1,11 +1,11 @@
 language: python
 language: python
-python: 3.5
+python: 3.6
 os:
 os:
   - linux
   - linux
 #  - osx
 #  - osx
 env:
 env:
   - TOX_ENV=py27
   - TOX_ENV=py27
-  - TOX_ENV=py35
+  - TOX_ENV=py36
   - TOX_ENV=pypy
   - TOX_ENV=pypy
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
@@ -19,4 +19,4 @@ script:
   - tox -e $TOX_ENV
   - tox -e $TOX_ENV
 after_success:
 after_success:
   - coveralls
   - coveralls
-  - codecov 
+  - codecov

+ 3 - 20
cloudbridge/cloud/providers/openstack/resources.py

@@ -1035,9 +1035,7 @@ class OpenStackBucketObject(BaseBucketObject):
 
 
     @property
     @property
     def name(self):
     def name(self):
-        """
-        Get this object's name.
-        """
+        """Get this object's name."""
         return self._obj.get("name")
         return self._obj.get("name")
 
 
     @property
     @property
@@ -1049,10 +1047,7 @@ class OpenStackBucketObject(BaseBucketObject):
         return self._obj.get("last_modified")
         return self._obj.get("last_modified")
 
 
     def iter_content(self):
     def iter_content(self):
-        """
-        Returns this object's content as an
-        iterable.
-        """
+        """Returns this object's content as an iterable."""
         _, content = self._provider.swift.get_object(
         _, content = self._provider.swift.get_object(
             self.cbcontainer.name, self.name, resp_chunk_size=65536)
             self.cbcontainer.name, self.name, resp_chunk_size=65536)
         return content
         return content
@@ -1068,18 +1063,6 @@ class OpenStackBucketObject(BaseBucketObject):
     def upload_from_file(self, path):
     def upload_from_file(self, path):
         """
         """
         Stores the contents of the file pointed by the "path" variable.
         Stores the contents of the file pointed by the "path" variable.
-        :param path: Absolute path to the file to be uploaded to S3.
-        :return: void
-        """
-        raise NotImplementedError("This functionality is not implemented yet.")
-
-    def upload_from_large_file(self, path):
-        """
-        Stores the contents of the large file pointed by the "path" variable.
-        This function split the file in smaller chunks, and uploads chunks
-        in turn.
-        :param path: Absolute path to the large file to be uploaded to S3.
-        :return: void
         """
         """
         raise NotImplementedError("This functionality is not implemented yet.")
         raise NotImplementedError("This functionality is not implemented yet.")
 
 
@@ -1087,7 +1070,7 @@ class OpenStackBucketObject(BaseBucketObject):
         """
         """
         Delete this object.
         Delete this object.
 
 
-        :rtype: bool
+        :rtype: ``bool``
         :return: True if successful
         :return: True if successful
         """
         """
         try:
         try:

+ 5 - 4
docs/topics/launch.rst

@@ -14,7 +14,7 @@ and 4 GB RAM.
 
 
 .. code-block:: python
 .. code-block:: python
 
 
-    img = provider.compute.images.get('ami-5ac2cd4d')  # Ubuntu 14.04 on AWS
+    img = provider.compute.images.get('ami-f4cc1de2')  # Ubuntu 16.04 on AWS
     inst_type = sorted([t for t in provider.compute.instance_types.list()
     inst_type = sorted([t for t in provider.compute.instance_types.list()
                         if t.vcpus >= 2 and t.ram >= 4],
                         if t.vcpus >= 2 and t.ram >= 4],
                        key=lambda x: x.vcpus*x.ram)[0]
                        key=lambda x: x.vcpus*x.ram)[0]
@@ -45,16 +45,17 @@ Private networking
 ~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~
 Private networking gives you control over the networking setup for your
 Private networking gives you control over the networking setup for your
 instance(s) and is considered the preferred method for launching instances. To
 instance(s) and is considered the preferred method for launching instances. To
-launch an instance with an explicit private network, just supply it as an
-additional argument to the ``create`` method:
+launch an instance with an explicit private network, supply a subnet within
+a network as an additional argument to the ``create`` method:
 
 
 .. code-block:: python
 .. code-block:: python
 
 
     provider.network.list()  # Find a desired network ID
     provider.network.list()  # Find a desired network ID
     net = provider.network.get('desired network ID')
     net = provider.network.get('desired network ID')
+    sn = net.subnets()[0]  # Get a handle on the desired subnet to launch with
     inst = provider.compute.instances.create(
     inst = provider.compute.instances.create(
         name='CloudBridge-VPC', image=img, instance_type=inst_type,
         name='CloudBridge-VPC', image=img, instance_type=inst_type,
-        network=net, key_pair=kp, security_groups=[sg])
+        subnet=sn, key_pair=kp, security_groups=[sg])
 
 
 For more information on how to create and setup a private network, take a look
 For more information on how to create and setup a private network, take a look
 at `Networking <./networking.html>`_.
 at `Networking <./networking.html>`_.