Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
9053edacd8 | |||
beb62c9f3d | |||
baac8f24fd | |||
e6bca5b6a9 | |||
b169620eee | |||
ee4d682b29 | |||
b221e0e954 |
68
.github/workflows/codeql-analysis.yml
vendored
Normal file
68
.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
# ******** NOTE ********
|
||||||
|
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ master ]
|
||||||
|
schedule:
|
||||||
|
- cron: '17 22 * * 2'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'python' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more...
|
||||||
|
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
@ -21,6 +21,14 @@ To get started with PVC, read the [Cluster Architecture document](https://parall
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
#### v0.9.4
|
||||||
|
|
||||||
|
* Fixes major bug in OVA parser
|
||||||
|
|
||||||
|
#### v0.9.3
|
||||||
|
|
||||||
|
* Fixes bugs with image & OVA upload parsing
|
||||||
|
|
||||||
#### v0.9.2
|
#### v0.9.2
|
||||||
|
|
||||||
* Major linting of the codebase with flake8; adds linting tools
|
* Major linting of the codebase with flake8; adds linting tools
|
||||||
|
@ -157,13 +157,16 @@ class RequestParser(object):
|
|||||||
parser = reqparse.RequestParser()
|
parser = reqparse.RequestParser()
|
||||||
# Parse and add each argument
|
# Parse and add each argument
|
||||||
for reqarg in self.reqargs:
|
for reqarg in self.reqargs:
|
||||||
|
location = reqarg.get('location', None)
|
||||||
|
if location is None:
|
||||||
|
location = ['args', 'form']
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
reqarg.get('name', None),
|
reqarg.get('name', None),
|
||||||
required=reqarg.get('required', False),
|
required=reqarg.get('required', False),
|
||||||
action=reqarg.get('action', None),
|
action=reqarg.get('action', None),
|
||||||
choices=reqarg.get('choices', ()),
|
choices=reqarg.get('choices', ()),
|
||||||
help=reqarg.get('helptext', None),
|
help=reqarg.get('helptext', None),
|
||||||
location=['args', 'form']
|
location=location
|
||||||
)
|
)
|
||||||
reqargs = parser.parse_args()
|
reqargs = parser.parse_args()
|
||||||
kwargs['reqargs'] = reqargs
|
kwargs['reqargs'] = reqargs
|
||||||
@ -3803,7 +3806,7 @@ api.add_resource(API_Storage_Ceph_Volume_Element_Clone, '/storage/ceph/volume/<p
|
|||||||
# /storage/ceph/volume/<pool>/<volume>/upload
|
# /storage/ceph/volume/<pool>/<volume>/upload
|
||||||
class API_Storage_Ceph_Volume_Element_Upload(Resource):
|
class API_Storage_Ceph_Volume_Element_Upload(Resource):
|
||||||
@RequestParser([
|
@RequestParser([
|
||||||
{'name': 'image_format', 'required': True, 'helpmsg': "A source image format must be specified."}
|
{'name': 'image_format', 'required': True, 'location': ['args'], 'helpmsg': "A source image format must be specified."}
|
||||||
])
|
])
|
||||||
@Authenticator
|
@Authenticator
|
||||||
def post(self, pool, volume, reqargs):
|
def post(self, pool, volume, reqargs):
|
||||||
@ -5846,9 +5849,9 @@ class API_Provisioner_OVA_Root(Resource):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@RequestParser([
|
@RequestParser([
|
||||||
{'name': 'pool', 'required': True, 'helpmsg': "A storage pool must be specified."},
|
{'name': 'pool', 'required': True, 'location': ['args'], 'helpmsg': "A storage pool must be specified."},
|
||||||
{'name': 'name', 'required': True, 'helpmsg': "A VM name must be specified."},
|
{'name': 'name', 'required': True, 'location': ['args'], 'helpmsg': "A VM name must be specified."},
|
||||||
{'name': 'ova_size', 'required': True, 'helpmsg': "An OVA size must be specified."},
|
{'name': 'ova_size', 'required': True, 'location': ['args'], 'helpmsg': "An OVA size must be specified."},
|
||||||
])
|
])
|
||||||
@Authenticator
|
@Authenticator
|
||||||
def post(self, reqargs):
|
def post(self, reqargs):
|
||||||
@ -5923,8 +5926,8 @@ class API_Provisioner_OVA_Element(Resource):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@RequestParser([
|
@RequestParser([
|
||||||
{'name': 'pool', 'required': True, 'helpmsg': "A storage pool must be specified."},
|
{'name': 'pool', 'required': True, 'location': ['args'], 'helpmsg': "A storage pool must be specified."},
|
||||||
{'name': 'ova_size', 'required': True, 'helpmsg': "An OVA size must be specified."},
|
{'name': 'ova_size', 'required': True, 'location': ['args'], 'helpmsg': "An OVA size must be specified."},
|
||||||
])
|
])
|
||||||
@Authenticator
|
@Authenticator
|
||||||
def post(self, ova, reqargs):
|
def post(self, ova, reqargs):
|
||||||
|
@ -1464,7 +1464,7 @@ def ceph_volume_upload(pool, volume, img_type):
|
|||||||
parse_form_data(flask.request.environ, stream_factory=image_stream_factory)
|
parse_form_data(flask.request.environ, stream_factory=image_stream_factory)
|
||||||
except Exception:
|
except Exception:
|
||||||
output = {
|
output = {
|
||||||
'message': "Failed to write image file to volume."
|
'message': "Failed to upload or write image file to temporary volume."
|
||||||
}
|
}
|
||||||
retcode = 400
|
retcode = 400
|
||||||
cleanup_maps_and_volumes()
|
cleanup_maps_and_volumes()
|
||||||
@ -1523,9 +1523,9 @@ def ceph_volume_upload(pool, volume, img_type):
|
|||||||
# rather than the standard stream_factory which writes to a temporary file waiting
|
# rather than the standard stream_factory which writes to a temporary file waiting
|
||||||
# on a save() call. This will break if the API ever uploaded multiple files, but
|
# on a save() call. This will break if the API ever uploaded multiple files, but
|
||||||
# this is an acceptable workaround.
|
# this is an acceptable workaround.
|
||||||
def ova_stream_factory(total_content_length, filename, content_type, content_length=None):
|
def image_stream_factory(total_content_length, filename, content_type, content_length=None):
|
||||||
return open(temp_blockdev, 'wb')
|
return open(temp_blockdev, 'wb')
|
||||||
parse_form_data(flask.request.environ, stream_factory=ova_stream_factory)
|
parse_form_data(flask.request.environ, stream_factory=image_stream_factory)
|
||||||
except Exception:
|
except Exception:
|
||||||
output = {
|
output = {
|
||||||
'message': "Failed to upload or write image file to temporary volume."
|
'message': "Failed to upload or write image file to temporary volume."
|
||||||
|
@ -316,6 +316,8 @@ def upload_ova(pool, name, ova_size):
|
|||||||
# Open the temporary blockdev and seek to byte 0
|
# Open the temporary blockdev and seek to byte 0
|
||||||
blk_file = open(temp_blockdev, 'wb')
|
blk_file = open(temp_blockdev, 'wb')
|
||||||
blk_file.seek(0)
|
blk_file.seek(0)
|
||||||
|
# Write the contents of vmdk_file into blk_file
|
||||||
|
blk_file.write(vmdk_file.read())
|
||||||
# Close blk_file (and flush the buffers)
|
# Close blk_file (and flush the buffers)
|
||||||
blk_file.close()
|
blk_file.close()
|
||||||
# Close vmdk_file
|
# Close vmdk_file
|
||||||
|
12
debian/changelog
vendored
12
debian/changelog
vendored
@ -1,3 +1,15 @@
|
|||||||
|
pvc (0.9.4-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* Fixes major bug in OVA parser
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Tue, 10 Nov 2020 15:33:50 -0500
|
||||||
|
|
||||||
|
pvc (0.9.3-0) unstable; urgency=high
|
||||||
|
|
||||||
|
* Fixes bugs with image & OVA upload parsing
|
||||||
|
|
||||||
|
-- Joshua M. Boniface <joshua@boniface.me> Mon, 09 Nov 2020 10:28:15 -0500
|
||||||
|
|
||||||
pvc (0.9.2-0) unstable; urgency=high
|
pvc (0.9.2-0) unstable; urgency=high
|
||||||
|
|
||||||
* Major linting of the codebase with flake8; adds linting tools
|
* Major linting of the codebase with flake8; adds linting tools
|
||||||
|
@ -19,6 +19,14 @@ To get started with PVC, read the [Cluster Architecture document](https://parall
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
#### v0.9.4
|
||||||
|
|
||||||
|
* Fixes major bug in OVA parser
|
||||||
|
|
||||||
|
#### v0.9.3
|
||||||
|
|
||||||
|
* Fixes bugs with image & OVA upload parsing
|
||||||
|
|
||||||
#### v0.9.2
|
#### v0.9.2
|
||||||
|
|
||||||
* Major linting of the codebase with flake8; adds linting tools
|
* Major linting of the codebase with flake8; adds linting tools
|
||||||
|
@ -54,7 +54,7 @@ import pvcnoded.CephInstance as CephInstance
|
|||||||
import pvcnoded.MetadataAPIInstance as MetadataAPIInstance
|
import pvcnoded.MetadataAPIInstance as MetadataAPIInstance
|
||||||
|
|
||||||
# Version string for startup output
|
# Version string for startup output
|
||||||
version = '0.9.2'
|
version = '0.9.4'
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# PVCD - node daemon startup program
|
# PVCD - node daemon startup program
|
||||||
|
Reference in New Issue
Block a user