summaryrefslogtreecommitdiff
path: root/cloudinit/version.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-05 11:56:48 -0400
committerScott Moser <smoser@brickies.net>2016-08-05 15:00:12 -0400
commit10f82bd474c5bc91b330beccd883da06b0014a99 (patch)
tree2d7e815950bac66d905f5481b54b732a0458d1ef /cloudinit/version.py
parent72d6adcb2e4cb5911f7809b89835965d4bf04476 (diff)
downloadvyos-cloud-init-10f82bd474c5bc91b330beccd883da06b0014a99.tar.gz
vyos-cloud-init-10f82bd474c5bc91b330beccd883da06b0014a99.zip
adjust tools and version information.
upstream snapshots are versioned in the format 'X.Y.Z+<distance>.g<commit>' where X.Y.Z are major, minor, and micro. Distance is number of commits since last annotated tag, and commit is the git commit. bddeb and brpm will now create and use the "upstream version" like above. Things changed here: - tools/make-tarball update cloudinit/version.py to contain the full version support --output support '--long' to always create the long format version string. - bddeb: - use quilt debian source format - use read-version and long version in changelog. - brpm: - change to use read-version and upstream long version in the spec. - flake8 changes - tools/read-version - read version from git or from cloudinit/version. - provide --json output with more nicely formed data.
Diffstat (limited to 'cloudinit/version.py')
-rw-r--r--cloudinit/version.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/cloudinit/version.py b/cloudinit/version.py
index 3d1d1d23..01785eb8 100644
--- a/cloudinit/version.py
+++ b/cloudinit/version.py
@@ -16,12 +16,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from distutils import version as vr
+__VERSION__ = "0.7.6"
+__EXPORT_VERSION__ = "@@EXPORT_VERSION@@"
-def version():
- return vr.StrictVersion("0.7.7")
+def version_string():
+ if not __EXPORT_VERSION__.startswith("@@"):
+ return __EXPORT_VERSION__
+ return __VERSION__
-def version_string():
- return str(version())
+def full_version_string():
+ if __EXPORT_VERSION__.startswith("@@"):
+ raise ValueError("No full version available")
+ return __EXPORT_VERSION__