diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -151,7 +151,7 @@ html_theme = 'alabaster' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied
fixup! Move sphinx requirements to a file for readthedocs
diff --git a/lxd/daemon.go b/lxd/daemon.go index <HASH>..<HASH> 100644 --- a/lxd/daemon.go +++ b/lxd/daemon.go @@ -735,14 +735,13 @@ func (d *Daemon) init() error { } /* Print welcome message */ + mode := "normal" if d.os.MockMode { - logger.Info(fmt.Sprintf("LXD %s is starting in mock mode", version.Version), - log.Ctx{"path": shared.VarPath("")}) - } else { - logger.Info(fmt.Sprintf("LXD %s is starting in normal mode", version.Version), - log.Ctx{"path": shared.VarPath("")}) + mode = "mock" } + logger.Info("LXD is starting", log.Ctx{"version": version.Version, "mode": mode, "path": shared.VarPath("")}) + /* List of sub-systems to trace */ trace := d.config.Trace
lxd/daemon: Modify LXD is starting message to use contextual logging
diff --git a/pyocd/debug/breakpoints/manager.py b/pyocd/debug/breakpoints/manager.py index <HASH>..<HASH> 100644 --- a/pyocd/debug/breakpoints/manager.py +++ b/pyocd/debug/breakpoints/manager.py @@ -1,5 +1,6 @@ # pyOCD debugger # Copyright (c) 2015-2019 Arm Limited +# Copyright (c) 2021 Chris Reed # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -127,7 +128,7 @@ class BreakpointManager(object): free_hw_bp_count += 1 for bp in added: likely_bp_type = self._select_breakpoint_type(bp, False) - if bp.type == Target.BreakpointType.HW: + if likely_bp_type == Target.BreakpointType.HW: free_hw_bp_count -= 1 return free_hw_bp_count > self.MIN_HW_BREAKPOINTS
BreakpointManager: fix bug in checking if HW BP can be added on flush. The to-be-added hardware breakpoints were not counted correctly due to not using the correct variable (probable copy/paste error).
diff --git a/cmd2.py b/cmd2.py index <HASH>..<HASH> 100755 --- a/cmd2.py +++ b/cmd2.py @@ -319,7 +319,8 @@ def get_paste_buffer(): """ pb_str = pyperclip.paste() - if six.PY2: + # If value returned from the clipboard is unicode and this is Python 2, convert to a "normal" Python 2 string first + if six.PY2 and not isinstance(pb_str, str): import unicodedata pb_str = unicodedata.normalize('NFKD', pb_str).encode('ascii', 'ignore')
Minor attempt at ruggedization of clipboard stuff in some weird cases on Python 2
diff --git a/src/Core/Result.php b/src/Core/Result.php index <HASH>..<HASH> 100644 --- a/src/Core/Result.php +++ b/src/Core/Result.php @@ -47,7 +47,7 @@ class Result extends Entity { array(":LID" => $LINK->id, ":CID" => $CONTEXT->id, ":UID" => $user_id) ); - $row = $stmt->fetch(PDO::FETCH_ASSOC); + $row = $stmt->fetch(\PDO::FETCH_ASSOC); return $row; }
One more bug - this is hard to test :(
diff --git a/jaraco/itertools.py b/jaraco/itertools.py index <HASH>..<HASH> 100644 --- a/jaraco/itertools.py +++ b/jaraco/itertools.py @@ -981,26 +981,25 @@ def list_or_single(iterable): 'a' """ warnings.warn("Use maybe_single", DeprecationWarning) - return maybe_single(iterable, sequence=list) + return maybe_single(list(iterable)) -def maybe_single(iterable, sequence=tuple): +def maybe_single(sequence): """ - Given an iterable, return the items as a sequence. - If the iterable contains exactly one item, return - that item. Correlary function to always_iterable. + Given a sequence, if it contains exactly one item, + return that item, otherwise return the sequence. + Correlary function to always_iterable. - >>> maybe_single(iter('abcd')) + >>> maybe_single(tuple('abcd')) ('a', 'b', 'c', 'd') >>> maybe_single(['a']) 'a' """ - result = sequence(iterable) try: - result, = result + single, = sequence except ValueError: - pass - return result + return sequence + return single def self_product(iterable):
Don't solicit the sequence as a parameter. Instead, expect the caller to supply a sequence.
diff --git a/source/rafcon/gui/interface.py b/source/rafcon/gui/interface.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/interface.py +++ b/source/rafcon/gui/interface.py @@ -10,6 +10,7 @@ # Rico Belder <rico.belder@dlr.de> import os +import glib from rafcon.core import interface as core_interface from rafcon.gui.runtime_config import global_runtime_config from rafcon.gui.singleton import main_window_controller, library_manager @@ -55,7 +56,13 @@ def open_folder(query, default_path=None): library_paths = library_manager.library_root_paths library_keys = sorted(library_paths) for library_key in library_keys: - dialog.add_shortcut_folder(library_paths[library_key]) + try: + dialog.add_shortcut_folder(library_paths[library_key]) + except glib.GError, e: + # this occurs if the shortcut file already exists + # unfortunately dialog.list_shortcut_folders() does not work + # that's why the error is caught + pass response = dialog.run()
fix file chooser bug fix case if the same folder is added to the shortcut_folders of the FileChooserDialog twice
diff --git a/versionner/cli.py b/versionner/cli.py index <HASH>..<HASH> 100755 --- a/versionner/cli.py +++ b/versionner/cli.py @@ -238,7 +238,7 @@ def execute(prog, argv): if result.modified_files: print('Changed' + (' and committed' if cfg.commit else '') + ' %(files)s files (%(changes)s changes)' % { 'files': result.modified_files, - 'changes': result.changes, + 'changes': result.modifications, }) return 0
fixed name of property of CommandOutput
diff --git a/Model/ModelManager.php b/Model/ModelManager.php index <HASH>..<HASH> 100644 --- a/Model/ModelManager.php +++ b/Model/ModelManager.php @@ -296,6 +296,17 @@ class ModelManager implements ModelManagerInterface } /** + * {@inheritDoc} + * + * The ORM implementation does nothing special but you still should use + * this method when using the id in a URL to allow for future improvements. + */ + public function getUrlsafeIdentifier($entity) + { + return $this->getNormalizedIdentifier($entity); + } + + /** * {@inheritdoc} */ public function addIdentifiersToQuery($class, ProxyQueryInterface $queryProxy, array $idx)
implement dummy version of getUrlsafeIdentifier
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,8 @@ const antd = { Icon: require('./components/iconfont'), Row: require('./components/layout').Row, Col: require('./components/layout').Col, - Spin: require('./components/spin') + Spin: require('./components/spin'), + Form: require('./components/form'), }; antd.version = require('./package.json').version;
feat: add form to antd.
diff --git a/src/Http/routes.php b/src/Http/routes.php index <HASH>..<HASH> 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /* * This file is part of Eloquent Viewable. *
revert: refactor: remove declare strict_type=1 from routes.php
diff --git a/lib/dm-migrations/version.rb b/lib/dm-migrations/version.rb index <HASH>..<HASH> 100644 --- a/lib/dm-migrations/version.rb +++ b/lib/dm-migrations/version.rb @@ -1,5 +1,5 @@ module DataMapper class Migration - VERSION = "0.9.5" + VERSION = "0.9.6" end end diff --git a/lib/migration.rb b/lib/migration.rb index <HASH>..<HASH> 100644 --- a/lib/migration.rb +++ b/lib/migration.rb @@ -1,5 +1,5 @@ require 'rubygems' -gem 'dm-core', '=0.9.5' +gem 'dm-core', '=0.9.6' require 'dm-core' require 'benchmark' require File.dirname(__FILE__) + '/sql' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,7 @@ def load_driver(name, default_uri) lib = "do_#{name}" begin - gem lib, '=0.9.5' + gem lib, '>=0.9.5' require lib DataMapper.setup(name, default_uri) DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]
Version Bump to <I>.
diff --git a/src/Robo/Commands/Tests/PhpUnitCommand.php b/src/Robo/Commands/Tests/PhpUnitCommand.php index <HASH>..<HASH> 100644 --- a/src/Robo/Commands/Tests/PhpUnitCommand.php +++ b/src/Robo/Commands/Tests/PhpUnitCommand.php @@ -3,6 +3,7 @@ namespace Acquia\Blt\Robo\Commands\Tests; use Acquia\Blt\Robo\BltTasks; +use Acquia\Blt\Robo\Exceptions\BltException; use Robo\Contract\VerbosityThresholdInterface; /** @@ -61,7 +62,11 @@ class PhpUnitCommand extends BltTasks { if (isset($test['config'])) { $task->option('--configuration', $test['config']); } - $task->run(); + $result = $task->run(); + $exit_code = $result->getExitCode(); + if ($exit_code) { + throw new BltException("PHPUnit tests failed."); + } } }
Fixes #<I>: PHPUnit Fatal Error Doesn't Fail Build. (#<I>)
diff --git a/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java b/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java index <HASH>..<HASH> 100644 --- a/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java +++ b/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java @@ -128,6 +128,6 @@ class NetworkCache { } private static String filenameForUrl(String url, FileExtension extension, boolean isTemp) { - return "lottie_cache_" + url.replaceAll("\\W+", "") + (isTemp ? extension.extension : extension.tempExtension()); + return "lottie_cache_" + url.replaceAll("\\W+", "") + (isTemp ? extension.tempExtension(): extension.extension); } }
resove bug local cache not working (#<I>)
diff --git a/admin/jqadm/themes/admin-aux.js b/admin/jqadm/themes/admin-aux.js index <HASH>..<HASH> 100644 --- a/admin/jqadm/themes/admin-aux.js +++ b/admin/jqadm/themes/admin-aux.js @@ -123,6 +123,7 @@ Aimeos.Media = { this.$set(this.items[prefix + 'typeid'], idx, listtypeid); this.$set(this.items['media.siteid'], idx, this.siteid); this.$set(this.items['media.languageid'], idx, null); + this.$set(this.items['media.status'], idx, 1); },
Set status of new media items to "enabled" by default
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,5 +36,8 @@ setup(name='anycall', author_email='scm@smurn.org', url='https://github.com/smurn/anycall', packages=['anycall'], - install_requires = ['twisted', 'utwist', 'bidict', 'twistit'], + install_requires = ['twisted>=15.0.0', + 'utwist>=0.1.2', + 'bidict>=0.3.1', + 'twistit>=0.2.0'], )
Added version requirements to dependencies.
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ os.environ.setdefault('CC', 'clang') setup( name='symsynd', - version='0.8.1', + version='0.8.2', url='http://github.com/getsentry/symsynd', description='Helps symbolicating crash dumps.', license='BSD', diff --git a/symsynd/driver.py b/symsynd/driver.py index <HASH>..<HASH> 100644 --- a/symsynd/driver.py +++ b/symsynd/driver.py @@ -123,7 +123,6 @@ class Driver(object): if sym_resp == input_command: raise SymbolicationError('Symbolizer echoed garbage.') - sym_resp = proc.stdout.readline() location_resp = proc.stdout.readline() empty_line = proc.stdout.readline()
Fixed a bug that caused symbolication to fail
diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php index <HASH>..<HASH> 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php @@ -247,7 +247,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract , 'lst' => self::$record_1->get_serialize_key() ); - $crawler = $this->client->request('POST', '/feeds/entry/UNKNOW/update/', $params); + $crawler = $this->client->request('POST', '/feeds/entry/99999999/update/', $params); $response = $this->client->getResponse(); @@ -351,7 +351,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract { $appbox = appbox::get_instance(); - $crawler = $this->client->request('POST', '/feeds/entry/UNKNOW/delete/'); + $crawler = $this->client->request('POST', '/feeds/entry/9999999/delete/'); $response = $this->client->getResponse();
fix testDelete & testDeleteNotFound
diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb index <HASH>..<HASH> 100644 --- a/omnibus/config/projects/chef.rb +++ b/omnibus/config/projects/chef.rb @@ -53,6 +53,16 @@ dependency "chef-complete" package :rpm do signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"] + + unless rhel? && platform_version.satisfies?("< 6") + compression_level 1 + compression_type :xz + end +end + +package :deb do + compression_level 1 + compression_type :xz end proj_to_work_around_cleanroom = self
Compress debs and rpms with xz
diff --git a/test/query.js b/test/query.js index <HASH>..<HASH> 100644 --- a/test/query.js +++ b/test/query.js @@ -244,6 +244,7 @@ describe('client.query()', function() { }); stream.on('error', function(error){ expect(error).to.be.ok(); + console.log(error); expect(error.code).to.equal(status.AEROSPIKE_OK); err++; });
For debugging scan aggregation failure
diff --git a/js/lib/mediawiki.ApiRequest.js b/js/lib/mediawiki.ApiRequest.js index <HASH>..<HASH> 100644 --- a/js/lib/mediawiki.ApiRequest.js +++ b/js/lib/mediawiki.ApiRequest.js @@ -329,6 +329,8 @@ TemplateRequest.prototype._handleJSON = function ( error, data ) { function PreprocessorRequest ( env, title, text ) { ApiRequest.call(this, env, title); + this.queueKey = text; + // Temporary debugging hack for // https://bugzilla.wikimedia.org/show_bug.cgi?id=49411 // Double-check the returned content language @@ -337,7 +339,6 @@ function PreprocessorRequest ( env, title, text ) { this.text = text; - this.queueKey = text; this.reqType = "Template Expansion"; var apiargs = {
Fix debug patch for content language Change-Id: I<I>f5da<I>a<I>ecd<I>fa<I>fb<I>e3
diff --git a/ReText/editor.py b/ReText/editor.py index <HASH>..<HASH> 100644 --- a/ReText/editor.py +++ b/ReText/editor.py @@ -20,7 +20,7 @@ import os import re import weakref -from markups import MarkdownMarkup, ReStructuredTextMarkup +from markups import MarkdownMarkup, ReStructuredTextMarkup, TextileMarkup from ReText import globalSettings, tablemode, readFromSettings from PyQt5.QtCore import pyqtSignal, QFileInfo, QRect, QSize, Qt @@ -310,6 +310,8 @@ class ReTextEdit(QTextEdit): imageText = '![%s](%s)' % (QFileInfo(link).baseName(), link) elif markupClass == ReStructuredTextMarkup: imageText = '.. image:: %s' % link + elif markupClass == TextileMarkup: + imageText = '!%s!' % link self.textCursor().insertText(imageText) else:
editor: Support pasting images to Textile
diff --git a/tests/connection.py b/tests/connection.py index <HASH>..<HASH> 100644 --- a/tests/connection.py +++ b/tests/connection.py @@ -222,7 +222,3 @@ class Connection_(Spec): def calls_invoke_Runner_run(self, invoke): Connection('host').local('foo') invoke.run.assert_called_with('foo') - - class sudo: - def calls_Remote_with_sudo_call_and_response_configuration(self): - skip()
I don't even know what this means
diff --git a/tests/e2e/end-to-end.tests.js b/tests/e2e/end-to-end.tests.js index <HASH>..<HASH> 100644 --- a/tests/e2e/end-to-end.tests.js +++ b/tests/e2e/end-to-end.tests.js @@ -93,6 +93,7 @@ Test('end to end tests', function(t) { Object.keys(require.cache).forEach(function(key) { delete require.cache[key] }) + restore(Mongoose) t.ok(true, 'DONE') })
bugfix: prevent test errors between runs due to residual data in db (#<I>)
diff --git a/salt/runner.py b/salt/runner.py index <HASH>..<HASH> 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -59,7 +59,8 @@ class RunnerClient(object): data['user'] = user event.fire_event(data, tagify('ret', base=tag)) # this is a workaround because process reaping is defeating 0MQ linger - time.sleep(2.0) # delat so 0MQ event gets out before runner process reaped + time.sleep(2.0) # delay so 0MQ event gets out before runner process + # reaped def _verify_fun(self, fun): '''
Two spaces before in-line comment.
diff --git a/resources/lang/hu-HU/pagination.php b/resources/lang/hu-HU/pagination.php index <HASH>..<HASH> 100644 --- a/resources/lang/hu-HU/pagination.php +++ b/resources/lang/hu-HU/pagination.php @@ -22,7 +22,7 @@ return [ | */ - 'previous' => 'Előző', - 'next' => 'Következő', + 'previous' => 'Previous', + 'next' => 'Next', ];
New translations pagination.php (Hungarian)
diff --git a/packages/cozy-client/src/CozyClient.js b/packages/cozy-client/src/CozyClient.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/CozyClient.js +++ b/packages/cozy-client/src/CozyClient.js @@ -1,4 +1,4 @@ -import { StackLink } from './CozyLink' +import StackLink from './StackLink' import { QueryDefinition, Mutations } from './dsl' import CozyStackClient from 'cozy-stack-client' import { diff --git a/packages/cozy-client/src/index.js b/packages/cozy-client/src/index.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/index.js +++ b/packages/cozy-client/src/index.js @@ -1,8 +1,9 @@ export { default } from './CozyClient' export { default as CozyProvider } from './Provider' +export { default as CozyLink } from './CozyLink' +export { default as StackLink } from './StackLink' export { default as connect } from './connect' export { default as withMutation } from './withMutation' -export { all, find } from './dsl' export { default as Query } from './Query' export { default as Mutations } from './Mutations' export { default as compose } from 'lodash/flow'
fix: Ensure StackLink is exported
diff --git a/rule_linux.go b/rule_linux.go index <HASH>..<HASH> 100644 --- a/rule_linux.go +++ b/rule_linux.go @@ -144,7 +144,7 @@ func ruleHandle(rule *Rule, req *nl.NetlinkRequest) error { req.AddData(nl.NewRtAttr(nl.FRA_OIFNAME, []byte(rule.OifName))) } if rule.Goto >= 0 { - msg.Type = nl.FR_ACT_NOP + msg.Type = nl.FR_ACT_GOTO b := make([]byte, 4) native.PutUint32(b, uint32(rule.Goto)) req.AddData(nl.NewRtAttr(nl.FRA_GOTO, b))
fix: fix ip rule goto bug
diff --git a/import_export/resources.py b/import_export/resources.py index <HASH>..<HASH> 100644 --- a/import_export/resources.py +++ b/import_export/resources.py @@ -328,7 +328,9 @@ class Resource(object): queryset = self.get_queryset() headers = self.get_export_headers() data = tablib.Dataset(headers=headers) - for obj in queryset: + # Iterate without the queryset cache, to avoid wasting memory when + # exporting large datasets. + for obj in queryset.iterator(): data.append(self.export_resource(obj)) return data
Bypass the queryset cache in Resource.export(). Without this, even moderately large exports (<I>k rows or more) can quickly exhaust a system's memory.
diff --git a/pysat/instruments/icon_mighti.py b/pysat/instruments/icon_mighti.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/icon_mighti.py +++ b/pysat/instruments/icon_mighti.py @@ -79,7 +79,9 @@ fname3b = ''.join(('ICON_L2-3_MIGHTI-B_Temperature_{year:04d}-{month:02d}', supported_tags = {'a': {'los_wind': fname1a, 'temperature': fname3a}, 'b': {'los-wind': fname1b, - 'temperature': fname3b}} + 'temperature': fname3b}, + 'green': {'vector_wind': fname2g}, + 'red': {'vector_wind': fname2r}} # use the CDAWeb methods list files routine list_files = functools.partial(mm_gen.list_files,
BUG: complete supported_tags in mighti
diff --git a/resources/lang/zh-CN/cachet.php b/resources/lang/zh-CN/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/zh-CN/cachet.php +++ b/resources/lang/zh-CN/cachet.php @@ -75,10 +75,11 @@ return [ // Subscriber 'subscriber' => [ - 'subscribe' => '订阅最新的更新。', - 'unsubscribe' => '使用这个链接取消订阅: :link', - 'button' => '订阅', - 'manage' => [ + 'subscribe' => '订阅最新的更新。', + 'unsubscribe' => 'Unsubscribe', + 'button' => '订阅', + 'manage_subscription' => 'Manage subscription', + 'manage' => [ 'no_subscriptions' => '您当前已订阅所有更新。', 'my_subscriptions' => '您当前已订阅下列更新', 'manage_at_link' => '在 :link 管理你的订阅',
New translations cachet.php (Chinese Simplified)
diff --git a/actions/MediaImport.php b/actions/MediaImport.php index <HASH>..<HASH> 100755 --- a/actions/MediaImport.php +++ b/actions/MediaImport.php @@ -41,7 +41,6 @@ class MediaImport extends \tao_actions_Import { /** * overwrite the parent index to add the import handlers * - * @requiresRight id WRITE * @see tao_actions_Import::index() */ public function index()
disable the write right to import a media
diff --git a/chef/lib/chef/knife/cookbook_site_install.rb b/chef/lib/chef/knife/cookbook_site_install.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/knife/cookbook_site_install.rb +++ b/chef/lib/chef/knife/cookbook_site_install.rb @@ -32,9 +32,9 @@ class Chef banner "knife cookbook site install COOKBOOK [VERSION] (options)" category "cookbook site" - option :deps, - :short => "-d", - :long => "--dependencies", + option :no_deps, + :short => "-D", + :long => "--no-dependencies", :boolean => true, :description => "Grab dependencies automatically" @@ -93,12 +93,12 @@ class Chef end - if config[:deps] + unless config[:no_deps] md = Chef::Cookbook::Metadata.new md.from_file(File.join(@install_path, @cookbook_name, "metadata.rb")) md.dependencies.each do |cookbook, version_list| # Doesn't do versions.. yet - nv = Chef::Knife::CookbookSiteVendor.new + nv = self.class.new nv.config = config nv.name_args = [ cookbook ] nv.run
make dependency fetching the default for cookbook site install
diff --git a/examples/keystore.js b/examples/keystore.js index <HASH>..<HASH> 100644 --- a/examples/keystore.js +++ b/examples/keystore.js @@ -41,7 +41,7 @@ var app = fortune({ , id = user.id || request.path.split('/').pop(); // require a password on user creation - if(request.method == 'post') { + if(request.method.toLowerCase() == 'post') { if(!!password) { return hashPassword(user, password); } else {
Update keystore example to proper request method request.method usually returns the method in all caps because that is how it is usually sent. A header will look something like: POST /users HTTP/<I> Host: localhost:<I> Content-Type: application/json so request.method will equal "POST"
diff --git a/test/backend-connection.test.js b/test/backend-connection.test.js index <HASH>..<HASH> 100644 --- a/test/backend-connection.test.js +++ b/test/backend-connection.test.js @@ -7,11 +7,11 @@ var TypeOf = utils.TypeOf; var InstanceOf = utils.InstanceOf; var Connection = require('../lib/backend/connection').Connection; -var MsgPackReceiver = require('../lib/backend/receiver').MsgPackReceiver; +var FluentReceiver = require('../lib/backend/receiver').FluentReceiver; function createBackend() { var deferred = new Deferred(); - var backend = new MsgPackReceiver(utils.testSendPort); + var backend = new FluentReceiver(utils.testSendPort); backend.received = []; backend.on('receive', function(data) { backend.received.push(data);
test: Use FluentReceiver isntead of MsgPackReceiver, because the backend is a fluentd.
diff --git a/lib/motion/project/cocoapods.rb b/lib/motion/project/cocoapods.rb index <HASH>..<HASH> 100644 --- a/lib/motion/project/cocoapods.rb +++ b/lib/motion/project/cocoapods.rb @@ -174,13 +174,17 @@ module Motion::Project end end + HEADERS_ROOT = File.join(PODS_ROOT, 'Headers') + def copy_cocoapods_env_and_prefix_headers headers = Dir.glob(["#{PODS_ROOT}/*.h", "#{PODS_ROOT}/*.pch"]) headers.each do |header| src = File.basename(header) dst = src.sub(/\.pch$/, '.h') - unless File.exist?("#{PODS_ROOT}/Headers/____#{dst}") - FileUtils.cp("#{PODS_ROOT}/#{src}", "#{PODS_ROOT}/Headers/____#{dst}") + dst_path = File.join(HEADERS_ROOT, "____#{dst}") + unless File.exist?(dst_path) + FileUtils.mkdir_p(HEADERS_ROOT) + FileUtils.cp(File.join(PODS_ROOT, src), dst_path) end end end
Ensure the Pods/Headers dir exists before copying. Fixes #<I>.
diff --git a/src/Agl/Core/Auth/Auth.php b/src/Agl/Core/Auth/Auth.php index <HASH>..<HASH> 100644 --- a/src/Agl/Core/Auth/Auth.php +++ b/src/Agl/Core/Auth/Auth.php @@ -70,7 +70,7 @@ class Auth $this->logout(); $this->_user = $pUser; - if ($this->isLogged()) { + if ($this->_user->getId()) { $this->_session->setUserId($this->_user->getId()); return true; }
A user is not logged in when passing directly an Item to Auth.
diff --git a/src/SectionField/Service/EntryNotFoundException.php b/src/SectionField/Service/EntryNotFoundException.php index <HASH>..<HASH> 100644 --- a/src/SectionField/Service/EntryNotFoundException.php +++ b/src/SectionField/Service/EntryNotFoundException.php @@ -17,7 +17,7 @@ use Throwable; class EntryNotFoundException extends \Exception { - public function __construct($message = '', $code = 0, Throwable $previous = null) + public function __construct($message = '', $code = 404, Throwable $previous = null) { $message = empty($message) ? 'Entry not found' : $message;
Entry not found throws <I>
diff --git a/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java b/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java +++ b/core/src/main/java/fr/labri/gumtree/io/ActionsIoUtils.java @@ -84,7 +84,6 @@ public final class ActionsIoUtils { Tree dst = mappings.getDst(src); writeTreePos(w, true, src); writeTreePos(w, false, dst); - w.writeEmptyElement("before"); } else if (a instanceof Insert) { Tree dst = a.getNode(); if (dst.isRoot()) writeInsertPos(w, true, new int[] {0, 0}); @@ -94,7 +93,6 @@ public final class ActionsIoUtils { else writeInsertPos(w, true, dst.getParent().getChildren().get(idx -1).getLcPosEnd()); } writeTreePos(w, false, dst); - w.writeEmptyElement("after"); } else if (a instanceof Delete) { Tree src = a.getNode(); writeTreePos(w, true, src);
fixed spurious before and after elements.
diff --git a/rshell.py b/rshell.py index <HASH>..<HASH> 100755 --- a/rshell.py +++ b/rshell.py @@ -153,7 +153,8 @@ def is_micropython_usb_device(port): usb_id = port[2].lower() else: # Assume its a pyudev.device.Device - if port['ID_BUS'] != 'usb' or port['SUBSYSTEM'] != 'tty': + if ('ID_BUS' not in port or port['ID_BUS'] != 'usb' or + 'SUBSYSTEM' not in port or port['SUBSYSTEM'] != 'tty'): return False usb_id = 'usb vid:pid={}:{}'.format(port['ID_VENDOR_ID'], port['ID_MODEL_ID']) # We don't check the last digit of the PID since there are 3 possible
Fix problem where ID_BUS or SUBSYSTEM doesn't exist in the usb device
diff --git a/src/main/GenomeTrack.js b/src/main/GenomeTrack.js index <HASH>..<HASH> 100644 --- a/src/main/GenomeTrack.js +++ b/src/main/GenomeTrack.js @@ -117,7 +117,7 @@ var NonEmptyGenomeTrack = React.createClass({ }, getScale: function() { var width = this.getDOMNode().offsetWidth; - return utils.getTrackScale(this.props.range, this.state.width); + return utils.getTrackScale(this.props.range, width); }, componentDidUpdate: function(prevProps: any, prevState: any) { if (!shallowEquals(prevProps, this.props) ||
pass the right width to the scale calculation
diff --git a/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java b/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java +++ b/src/main/java/com/blackducksoftware/integration/hub/dataservices/notification/items/PolicyViolationClearedContentItem.java @@ -16,4 +16,13 @@ public class PolicyViolationClearedContentItem extends PolicyViolationContentIte super(createdAt, projectVersion, componentName, componentVersion, componentId, componentVersionId, policyRuleList); } + + @Override + public String toString() { + return "PolicyViolationClearedContentItem [getPolicyRuleList()=" + getPolicyRuleList() + + ", getProjectVersion()=" + getProjectVersion() + ", getComponentName()=" + getComponentName() + + ", getComponentVersion()=" + getComponentVersion() + ", getComponentId()=" + getComponentId() + + ", getComponentVersionId()=" + getComponentVersionId() + ", getCreatedAt()=" + getCreatedAt() + "]"; + } + }
IHCIC-<I>: Added missing toString()
diff --git a/crosscat/tests/test_log_likelihood.py b/crosscat/tests/test_log_likelihood.py index <HASH>..<HASH> 100644 --- a/crosscat/tests/test_log_likelihood.py +++ b/crosscat/tests/test_log_likelihood.py @@ -124,8 +124,8 @@ def summary_plotter(results, dirname='./'): pylab.plot(xlim, xlim) return def _plot_and_save(frame, variable_suffix, dirname='./'): - x = frame['final_' + variable_suffix] - y = frame['gen_' + variable_suffix] + x = frame['gen_' + variable_suffix] + y = frame['final_' + variable_suffix] _scatter(x, y) pylab.title(variable_suffix) filename = variable_suffix
summary scatter: fix inverted sense of {in,}dependent variable
diff --git a/metpy/tests/test_units.py b/metpy/tests/test_units.py index <HASH>..<HASH> 100644 --- a/metpy/tests/test_units.py +++ b/metpy/tests/test_units.py @@ -58,6 +58,7 @@ def test_axvline(): def test_atleast1d_without_units(): """Test that atleast_1d wrapper can handle plain arrays.""" assert_array_equal(atleast_1d(1), np.array([1])) + assert_array_equal(atleast_1d([1, ], [2, ]), np.array([[1, ], [2, ]])) def test_atleast2d_without_units(): @@ -65,6 +66,12 @@ def test_atleast2d_without_units(): assert_array_equal(atleast_2d(1), np.array([[1]])) +def test_atleast2d_with_units(): + """Test that atleast_2d wrapper can handle plain array with units.""" + assert_array_equal( + atleast_2d(1 * units.degC), np.array([[1]]) * units.degC) + + def test_units_diff(): """Test our diff handles units properly.""" assert_array_equal(diff(np.arange(20, 22) * units.degC),
increase coverage of metpy.units
diff --git a/src/Template/Template.php b/src/Template/Template.php index <HASH>..<HASH> 100644 --- a/src/Template/Template.php +++ b/src/Template/Template.php @@ -18,7 +18,7 @@ class Template /** * The name of the template. - * @var string + * @var Name */ protected $name; @@ -222,7 +222,7 @@ class Template { foreach (explode('|', $functions) as $function) { if ($this->engine->doesFunctionExist($function)) { - $var = call_user_func(array($this->template, $function), $var); + $var = call_user_func(array($this, $function), $var); } elseif (is_callable($function)) { $var = call_user_func($function, $var); } else {
Fix bug with batch function in Template. Update name property docblock in Template.
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -83,7 +83,8 @@ function isValidQueryCharacter(ch) { } const gen = [':', '/', '?', '#', '[', ']', '@'].map(code) const sub = ['!', '$', '&', "'", '(', ')', '*', '+', ',', ';', '='].map(code) - return concat(ALPHA, DIGIT, gen, sub, code('.')).indexOf(code(ch)) > -1 + const pct = ['%', '-', '_', '~'].map(code) + return concat(ALPHA, DIGIT, gen, sub, pct, code('.')).indexOf(code(ch)) > -1 } // fragment = *( pchar / "/" / "?" )
fix(index.js): Add missing chars for parse Adds missing characters (%, -, _ and ~) for isValidQueryCharacter
diff --git a/tests/test_render.py b/tests/test_render.py index <HASH>..<HASH> 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -30,7 +30,7 @@ class TestPageRenderers(unittest.TestCase): # f.write(rendered_page) - def test_full_oobe_flow(sefl): + def test_full_oobe_flow(self): df = ge.read_csv("examples/data/Titanic.csv") # df = ge.read_csv("examples/data/Meteorite_Landings.csv") df.autoinspect(ge.dataset.autoinspect.pseudo_pandas_profiling) @@ -42,8 +42,8 @@ class TestPageRenderers(unittest.TestCase): rendered_page = R.render() assert rendered_page != None - with open('./test.html', 'w') as f: - f.write(rendered_page) + # with open('./test.html', 'w') as f: + # f.write(rendered_page) class TestSectionRenderers(unittest.TestCase):
Suppress file write to appease travis
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -378,6 +378,15 @@ test("Readability", function () { equal (tinycolor.mostReadable("#f00", ["#d00", "#0d0"]).toHexString(), "#00dd00", "pick most readable color"); }); +test("Filters", function () { + + equal (tinycolor("red").toFilter(), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffff0000,endColorstr=#ffff0000)"); + equal (tinycolor("red").toFilter("blue"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffff0000,endColorstr=#ff0000ff)"); + + equal(tinycolor("transparent").toFilter(), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#00000000)"); + equal(tinycolor("transparent").toFilter("red"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ffff0000)"); +}); + /* Too slow: 1677731 possibilities asyncTest("Ajax load", function() {
add tests for issue #<I> (toFilter)
diff --git a/lib/jUI.php b/lib/jUI.php index <HASH>..<HASH> 100644 --- a/lib/jUI.php +++ b/lib/jUI.php @@ -16,12 +16,6 @@ See LICENSE or LICENSE_COM for more information =====================================================ATK4=*/ class jUI extends jQuery { - /* - ATK4 system for javascript file management - */ - public $dir=null; - private $theme=false; - private $atk4_initialised=false; function init(){
jUI: unused variables I guess these are some leftovers from old versions
diff --git a/command/agent/agent.go b/command/agent/agent.go index <HASH>..<HASH> 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -314,9 +314,18 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) { if conf == nil { conf = clientconfig.DefaultConfig() } + + // If we are running a server, append both its bind and advertise address so + // we are able to at least talk to the local server even if that isn't + // configured explicitly. This handles both running server and client on one + // host and -dev mode. + conf.Servers = a.config.Client.Servers if a.server != nil { - conf.RPCHandler = a.server + conf.Servers = append(conf.Servers, + a.config.Addresses.RPC, + a.config.AdvertiseAddrs.RPC) } + conf.LogOutput = a.logOutput conf.LogLevel = a.config.LogLevel conf.DevMode = a.config.DevMode @@ -333,7 +342,6 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) { if a.config.Client.AllocDir != "" { conf.AllocDir = a.config.Client.AllocDir } - conf.Servers = a.config.Client.Servers if a.config.Client.NetworkInterface != "" { conf.NetworkInterface = a.config.Client.NetworkInterface }
Do not bypass normal RPC codepath when running both client and server at once
diff --git a/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php b/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php index <HASH>..<HASH> 100644 --- a/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php +++ b/application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php @@ -331,8 +331,11 @@ class CIPHPUnitTestRequest // Set CodeIgniter instance to TestCase $this->testCase->setCI($CI); - // Set default response code 200 - set_status_header(200); + if (!isset($CI->output->_status)) { // prevent overwriting, if already set in the $class::__construct() + // Set default response code 200 + set_status_header(200); + } + // Run callable if ($this->callables !== []) {
Don't overwrite the response set in __construct() It would be set to `<I>`, no matter what. If a satus was set in the constructor, it would get replaced with `<I>`.
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -18,13 +18,16 @@ from setuptools import find_packages, setup -with open('requirements.txt', 'rt') as reqs_file: +with open('requirements.txt', 'rt', encoding="ascii") as reqs_file: REQUIREMENTS = reqs_file.readlines() +with open('README.rst', encoding="ascii") as readme_file: + readme_content = readme_file.read() + setup( name='foremast', description='Tools for creating infrastructure and Spinnaker Pipelines.', - long_description=open('README.rst').read(), + long_description=readme_content, long_description_content_type='text/x-rst', author='Foremast', author_email='ps-devops-tooling@example.com',
fix: file open linting issues in setup.py
diff --git a/phoebe/atmospheres/create_atmospherefits.py b/phoebe/atmospheres/create_atmospherefits.py index <HASH>..<HASH> 100644 --- a/phoebe/atmospheres/create_atmospherefits.py +++ b/phoebe/atmospheres/create_atmospherefits.py @@ -21,6 +21,7 @@ try: # Pyfits now integrated in astropy except: import astropy.io.fits as pyfits import argparse +import scipy.ndimage.filters logger = logging.getLogger("ATM.GRID")
Smoothing before computing beaming factors to avoid numerical issues caused by metal lines
diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py index <HASH>..<HASH> 100644 --- a/ryu/services/protocols/bgp/base.py +++ b/ryu/services/protocols/bgp/base.py @@ -285,7 +285,7 @@ class Activity(object): """Stops all threads spawn by this activity. """ for thread_name, thread in list(self._child_thread_map.items()): - if name is not None and thread_name is name: + if name is None or thread_name == name: LOG.debug('%s: Stopping child thread %s', self.name, thread_name) thread.kill()
Fix major bug in child thread cleanup logic Without this fix, one cannot restart BGP Speaker instances
diff --git a/tests/databases/api_tests.py b/tests/databases/api_tests.py index <HASH>..<HASH> 100644 --- a/tests/databases/api_tests.py +++ b/tests/databases/api_tests.py @@ -358,7 +358,6 @@ class TestDatabaseApi(SupersetTestCase): database_data = {"database_name": "test-database-updated"} uri = f"api/v1/database/{test_database.id}" rv = self.client.put(uri, json=database_data) - print(rv.data.decode("utf-8"), database_data) self.assertEqual(rv.status_code, 200) # Cleanup model = db.session.query(Database).get(test_database.id)
chore: clean up a debug line from #<I> (#<I>)
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -25,6 +25,8 @@ module.exports = function (options) { } } + config.hooks = require('./hooks')(config.plugins) + _.each(_.values(config.paths), _.ary(mkdirp.sync, 1)) var bindAddress = options.bindAddress || '127.0.0.1' diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -44,8 +44,6 @@ exports.init = function (env_config, callback) { } exports.configureServer = function (server, env_config, callback) { - env_config.hooks = require('./hooks')(env_config.plugins) - server.connection({ port: env_config.app.port, labels: ['web']
refactor(hooks): move initialisation to config
diff --git a/moban/utils.py b/moban/utils.py index <HASH>..<HASH> 100644 --- a/moban/utils.py +++ b/moban/utils.py @@ -72,7 +72,7 @@ def write_file_out(filename, content): mkdir_p(dest_folder) if PY2: - if isinstance(filename, unicode): + if isinstance(filename, unicode) is False: filename = unicode(filename) dir_name = fs_path.dirname(filename) the_file_name = fs_path.basename(filename)
:green_heart: fix file writing
diff --git a/sentry/helpers.py b/sentry/helpers.py index <HASH>..<HASH> 100644 --- a/sentry/helpers.py +++ b/sentry/helpers.py @@ -76,7 +76,7 @@ def transform(value): return str(value) except: return to_unicode(value) - elif hasattr(value, '__sentry__'): + elif callable(getattr(value, '__sentry__', None)): return value.__sentry__() elif not isinstance(value, (int, bool)) and value is not None: # XXX: we could do transform(repr(value)) here
Log helper bugfix: check that __sentry__ is callable first
diff --git a/examples/nautilus.py b/examples/nautilus.py index <HASH>..<HASH> 100755 --- a/examples/nautilus.py +++ b/examples/nautilus.py @@ -8,8 +8,8 @@ import os from babelfish import Language from gi.repository import GObject, Gtk, Nautilus -from subliminal import (VIDEO_EXTENSIONS, ProviderPool, __copyright__, __version__, check_video, provider_manager, region, save_subtitles, scan_video, - scan_videos, compute_score) +from subliminal import (VIDEO_EXTENSIONS, ProviderPool, __copyright__, __version__, check_video, compute_score, + provider_manager, region, save_subtitles, scan_video, scan_videos) from subliminal.cli import Config, MutexLock, app_dir, cache_file, config_file locale.bindtextdomain('subliminal', os.path.join(os.path.dirname(__file__), 'subliminal', 'locale'))
pep8 for nautilus
diff --git a/doc/sphinxext/gen_rst.py b/doc/sphinxext/gen_rst.py index <HASH>..<HASH> 100644 --- a/doc/sphinxext/gen_rst.py +++ b/doc/sphinxext/gen_rst.py @@ -61,7 +61,7 @@ HLIST_IMAGE_TEMPLATE = """ * .. image:: images/%s - :scale: 50 + :scale: 47 """ SINGLE_IMAGE = """
MISC: make sure two figures hold on a line
diff --git a/src/python/dxpy/bindings/search.py b/src/python/dxpy/bindings/search.py index <HASH>..<HASH> 100644 --- a/src/python/dxpy/bindings/search.py +++ b/src/python/dxpy/bindings/search.py @@ -426,10 +426,16 @@ def find_projects(name=None, level=None, describe=None, public=None, **kwargs): resp = dxpy.api.systemFindProjects(query, **kwargs) - for i in resp["results"]: - yield i - if "public" in resp: + if 'public' in resp: + found_projects = {} + for i in resp["results"]: + found_projects[i['id']] = True + yield i for i in resp["public"]: + if i['id'] not in found_projects: + yield i + else: + for i in resp["results"]: yield i def find_apps(name=None, category=None, all_versions=None, published=None,
fixing bug where public projects that you explicitly have >= VIEW are reported twice
diff --git a/logger.go b/logger.go index <HASH>..<HASH> 100644 --- a/logger.go +++ b/logger.go @@ -497,13 +497,19 @@ func (l *Logger) Scan(r io.Reader) (cancel func()) { // Clone returns a copy of this "l" Logger. // This copy is returned as pointer as well. func (l *Logger) Clone() *Logger { + // copy level output map. + levelOutput := make(map[Level]io.Writer, len(l.LevelOutput)) + for k, v := range l.LevelOutput { + levelOutput[k] = v + } + return &Logger{ Prefix: l.Prefix, Level: l.Level, TimeFormat: l.TimeFormat, NewLine: l.NewLine, Printer: l.Printer, - LevelOutput: l.LevelOutput, + LevelOutput: levelOutput, handlers: l.handlers, children: newLoggerMap(), mu: sync.Mutex{},
copy leveled outputs on Clone
diff --git a/functional/client_test.go b/functional/client_test.go index <HASH>..<HASH> 100644 --- a/functional/client_test.go +++ b/functional/client_test.go @@ -39,7 +39,14 @@ func TestKnownHostsVerification(t *testing.T) { t.Errorf("Unable to SSH into fleet machine: \nstdout: %s\nstderr: %s\nerr: %v", stdout, stderr, err) } - // Recreation of the cluster simulates a change in the server's host key + // Gracefully poweroff the machine to allow fleet to purge its state. + cluster.PoweroffMember("1") + + machines, err = cluster.WaitForNMachines(0) + if err != nil { + t.Fatal(err) + } + cluster.DestroyMember("1") cluster.CreateMember("1", platform.MachineConfig{}) machines, err = cluster.WaitForNMachines(1)
functional: wait for machine to shut down
diff --git a/src/Parser/Anime/EpisodesParser.php b/src/Parser/Anime/EpisodesParser.php index <HASH>..<HASH> 100644 --- a/src/Parser/Anime/EpisodesParser.php +++ b/src/Parser/Anime/EpisodesParser.php @@ -57,8 +57,14 @@ class EpisodesParser implements ParserInterface public function getEpisodesLastPage(): int { $episodesLastPage = $this->crawler - ->filterXPath('//div[contains(@class, \'pagination\')]') - ->children(); + ->filterXPath('//div[contains(@class, \'pagination\')]'); + + if (!$episodesLastPage->count()) { + return 1; + } + + $episodesLastPage = $episodesLastPage->children(); + if ($episodesLastPage->getNode(1)->tagName === 'span') { $episodesLastPage = $episodesLastPage
review AnimeEpisodes
diff --git a/metric_tank/http.go b/metric_tank/http.go index <HASH>..<HASH> 100644 --- a/metric_tank/http.go +++ b/metric_tank/http.go @@ -85,6 +85,11 @@ func Get(w http.ResponseWriter, req *http.Request, store Store, defCache *DefCac http.Error(w, "missing target arg", http.StatusBadRequest) return } + if len(targets)*int(maxDataPoints) > 100*1000 { + http.Error(w, "too much data requested", http.StatusBadRequest) + return + } + now := time.Now() fromUnix := uint32(now.Add(-time.Duration(24) * time.Hour).Unix()) toUnix := uint32(now.Add(time.Duration(1) * time.Second).Unix()) @@ -110,6 +115,10 @@ func Get(w http.ResponseWriter, req *http.Request, store Store, defCache *DefCac http.Error(w, "to must be higher than from", http.StatusBadRequest) return } + if len(targets)*int(toUnix-fromUnix) > 2*365*24*3600 { + http.Error(w, "too much data requested", http.StatusBadRequest) + return + } reqs := make([]Req, len(targets)) for i, target := range targets {
limit amount of points and timeframe you can query
diff --git a/src/Illuminate/Session/SessionServiceProvider.php b/src/Illuminate/Session/SessionServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Session/SessionServiceProvider.php +++ b/src/Illuminate/Session/SessionServiceProvider.php @@ -116,6 +116,11 @@ class SessionServiceProvider extends ServiceProvider { */ protected function registerCloseEvent() { + if ($this->getDriver() == 'array') return; + + // The cookie toucher is responsbile for updating the expire time on the cookie + // so that it is refreshed for each page load. Otherwise it is only set here + // once by PHP and never updated on each subsequent page load of the apps. $this->registerCookieToucher(); $app = $this->app; @@ -166,4 +171,14 @@ class SessionServiceProvider extends ServiceProvider { return $config['lifetime'] == 0 ? 0 : time() + ($config['lifetime'] * 60); } + /** + * Get the session driver name. + * + * @return string + */ + protected function getDriver() + { + return $this->app['config']['session.driver']; + } + } \ No newline at end of file
Do not set cookie when using array driver.
diff --git a/pptx/chart/series.py b/pptx/chart/series.py index <HASH>..<HASH> 100644 --- a/pptx/chart/series.py +++ b/pptx/chart/series.py @@ -118,7 +118,7 @@ class BarSeries(_BaseCategorySeries): """ msg = ( 'BarSeries.fill property is deprecated and will be removed in a ' - 'future release.' + 'future release Use .format.fill instead.' ) warn(msg, UserWarning, stacklevel=2) diff --git a/pptx/shapes/placeholder.py b/pptx/shapes/placeholder.py index <HASH>..<HASH> 100644 --- a/pptx/shapes/placeholder.py +++ b/pptx/shapes/placeholder.py @@ -300,7 +300,7 @@ class ChartPlaceholder(_BaseSlidePlaceholder): Return a newly created `p:graphicFrame` element having the specified position and size and containing the chart identified by *rId*. """ - id_, name = self.id, self.name + id_, name = self.shape_id, self.name return CT_GraphicalObjectFrame.new_chart_graphicFrame( id_, name, rId, x, y, cx, cy )
fix: a couple of lingering deprecation warnings
diff --git a/opt/cs50/submit50/bin/submit50.py b/opt/cs50/submit50/bin/submit50.py index <HASH>..<HASH> 100755 --- a/opt/cs50/submit50/bin/submit50.py +++ b/opt/cs50/submit50/bin/submit50.py @@ -186,6 +186,14 @@ def submit(problem): config = {"course": course} with open(CONFIG_PATH, "w") as f: json.dump(config, f) + + # course identifier specified at command line, cache it + else: + with open(CONFIG_PATH, "r") as f: + config = json.load(f) + config["course"] = course + with open(CONFIG_PATH, "w") as f: + json.dump(config, f) # ensure problem exists global EXCLUDE
Cache course identifier if provided at command line
diff --git a/lib/moped/database.rb b/lib/moped/database.rb index <HASH>..<HASH> 100644 --- a/lib/moped/database.rb +++ b/lib/moped/database.rb @@ -115,8 +115,10 @@ module Moped # @since 1.0.0 def collection_names Collection.new(self, "system.namespaces"). - find(name: { "$not" => /system|\$/ }).to_a. - map{|collection| collection["name"].split(".", 2).last} + find(name: { "$not" => /system|\$/ }). + map do |doc| + doc["name"].sub(/^#{name}./, '') + end end end end
Slight change in collection_names
diff --git a/lib/whenever/capistrano.rb b/lib/whenever/capistrano.rb index <HASH>..<HASH> 100644 --- a/lib/whenever/capistrano.rb +++ b/lib/whenever/capistrano.rb @@ -1,3 +1,4 @@ +require 'capistrano/version' if defined?(Capistrano::VERSION) && Gem::Version.new(Capistrano::VERSION).release >= Gem::Version.new('3.0.0') load File.expand_path("../tasks/whenever.rake", __FILE__) else
load capistrano/version so we can test it.
diff --git a/lib/motion/project/cocoapods.rb b/lib/motion/project/cocoapods.rb index <HASH>..<HASH> 100644 --- a/lib/motion/project/cocoapods.rb +++ b/lib/motion/project/cocoapods.rb @@ -88,7 +88,6 @@ module Motion::Project @podfile.platform(platform, config.deployment_target) @podfile.target(TARGET_NAME) cp_config.podfile = @podfile - cp_config.skip_repo_update = true cp_config.installation_root = Pathname.new(File.expand_path(config.project_dir)) + 'vendor' if cp_config.verbose = !!ENV['COCOAPODS_VERBOSE']
remove `skip_repo_update' which was removed at CocoaPods <I>.beta<I> <URL>
diff --git a/client/info.go b/client/info.go index <HASH>..<HASH> 100644 --- a/client/info.go +++ b/client/info.go @@ -4,6 +4,8 @@ import ( "fmt" "strings" + "github.com/docker/go-units" + gflag "github.com/jessevdk/go-flags" ) @@ -51,14 +53,6 @@ func (cli *HyperClient) HyperCmdInfo(args ...string) error { } func getMemSizeString(s int) string { - var rtn float64 - if s < 1024*1024 { - return fmt.Sprintf("%d KB", s) - } else if s < 1024*1024*1024 { - rtn = float64(s) / (1024.0 * 1024.0) - return fmt.Sprintf("%.1f MB", rtn) - } else { - rtn = float64(s) / (1024.0 * 1024.0 * 1024.0) - return fmt.Sprintf("%.1f GB", rtn) - } + rtn := float64(s) + return units.HumanSize(rtn) }
when dealing memory size, use go-units
diff --git a/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js b/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js index <HASH>..<HASH> 100644 --- a/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js +++ b/src/geo/leaflet/leaflet-cartodb-vector-layer-group-view.js @@ -30,9 +30,6 @@ var LeafletCartoDBVectorLayerGroupView = CartoDBd3Layer.extend({ layerModel.layers.bind('change:meta', function (child, meta) { var index = layerModel.layers.indexOf(child); this.options.styles[index] = meta.cartocss; - if (this.options.styles.indexOf(undefined) === -1) { - this.setUrl(this.model.get('urls').tiles[0]); - } }, this); layerModel.layers.each(function (layer) { @@ -66,6 +63,7 @@ var LeafletCartoDBVectorLayerGroupView = CartoDBd3Layer.extend({ _onTileJSONChanged: function () { var tilejson = this.model.get('urls'); this.options.styles = this.model.layers.pluck('cartocss'); + this.setUrl(this.model.get('urls').tiles[0]); }, onAdd: function (map) {
sets styles in meta withougt setting url
diff --git a/ui/src/dashboards/graphics/graph.js b/ui/src/dashboards/graphics/graph.js index <HASH>..<HASH> 100644 --- a/ui/src/dashboards/graphics/graph.js +++ b/ui/src/dashboards/graphics/graph.js @@ -503,6 +503,7 @@ export const GRAPH_TYPES = [ menuOption: 'Gauge', graphic: GRAPH_SVGS.gauge, }, + // FEATURE FLAG for Table-Graph // { // type: 'table', // menuOption: 'Table',
Add comment indicating location of feature flag
diff --git a/lib/waterline/utils/query/help-find.js b/lib/waterline/utils/query/help-find.js index <HASH>..<HASH> 100644 --- a/lib/waterline/utils/query/help-find.js +++ b/lib/waterline/utils/query/help-find.js @@ -66,6 +66,20 @@ module.exports = function helpFind(WLModel, s2q, omen, done) { // Set up a few, common local vars for convenience / familiarity. var orm = WLModel.waterline; + // Keep track of any populates which were explicitly set to `false`. + // (This is a special indicator that FS2Q adds when a particular subcriteria + // turns out to be a no-op. This is important so that we make sure to still + // explicitly attach the appropriate base value for the association-- for + // example an empty array `[]`. This avoids breaking any userland code which + // might be relying on the datatype, such as a `.length`, a `x[n]`, or a loop.) + var populatesExplicitlySetToFalse = []; + for (var assocAttrName in s2q.populates) { + var subcriteria = s2q.populates[assocAttrName]; + if (subcriteria === false) { + populatesExplicitlySetToFalse.push(assocAttrName); + } + }//∞ + // Build an initial stage three query (s3q) from the incoming stage 2 query (s2q). var parentQuery = forgeStageThreeQuery({ stageTwoQuery: s2q,
Track associations explicitly set to false in help-find util
diff --git a/goxpath/goxpath.go b/goxpath/goxpath.go index <HASH>..<HASH> 100644 --- a/goxpath/goxpath.go +++ b/goxpath/goxpath.go @@ -14,6 +14,15 @@ func Exec(xp XPathExec, t tree.Node, ns map[string]string) ([]tree.Res, error) { return parser.Exec(xp, t, ns) } +//MustExec is like Exec, but panics instead of returning an error. +func MustExec(xp XPathExec, t tree.Node, ns map[string]string) []tree.Res { + res, err := parser.Exec(xp, t, ns) + if err != nil { + panic(err) + } + return res +} + //MustParse is like Parse, but panics instead of returning an error. func MustParse(xp string) XPathExec { return parser.MustParse(xp)
Adding a MustExec method for convenience.
diff --git a/buildbot/test/test_vc.py b/buildbot/test/test_vc.py index <HASH>..<HASH> 100644 --- a/buildbot/test/test_vc.py +++ b/buildbot/test/test_vc.py @@ -2598,7 +2598,7 @@ class MercurialInRepoHelper(MercurialHelper): vc_try_checkout = deferredGenerator(vc_try_checkout) def vc_try_finish(self, workdir): -# rmdirRecursive(workdir) + rmdirRecursive(workdir) pass
Remove accidentally left comment from cleanup step in MercurialInRepo test
diff --git a/src/buildApp.js b/src/buildApp.js index <HASH>..<HASH> 100644 --- a/src/buildApp.js +++ b/src/buildApp.js @@ -63,8 +63,8 @@ function buildApp(options, callback) { (appPathArray, callback) => { // somehow appPathArray is a 1 element array - if (appPathArray.length !== 1) { - console.warn('Warning: Packaged app path contains more than one element', appPathArray); + if (appPathArray.length > 1) { + console.warn('Warning: Packaged app path contains more than one element:', appPathArray); } const appPath = appPathArray[0]; callback(null, appPath);
Fix bug in console warning when not overwritting an existing executable
diff --git a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js b/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js index <HASH>..<HASH> 100644 --- a/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js +++ b/plugins/SitesManager/angularjs/sites-manager/api-helper.service.js @@ -43,7 +43,7 @@ function commaDelimitedFieldToArray (value) { - if(value === undefined || value === null || value === '') + if(!value) return []; return value.split(',');
refs #<I> fix sites manager was broken
diff --git a/fleet.go b/fleet.go index <HASH>..<HASH> 100644 --- a/fleet.go +++ b/fleet.go @@ -50,7 +50,7 @@ func main() { cfgset.String("metadata", "", "List of key-value metadata to assign to the fleet machine") cfgset.String("unit_prefix", "", "Prefix that should be used for all systemd units") cfgset.String("agent_ttl", agent.DefaultTTL, "TTL in seconds of fleet machine state in etcd") - cfgset.Bool("verify_units", true, "Verify unit file signatures using local SSH identities") + cfgset.Bool("verify_units", false, "Verify unit file signatures using local SSH identities") cfgset.String("authorized_key_file", sign.DefaultAuthorizedKeyFile, "File that contains authorized keys to be used for signature verification") globalconf.Register("", cfgset)
chore(fleet): set verify_units to be false as default This should have consistent default value with `verify` and `sign` in fleetctl.
diff --git a/spec/tree/assess/TreeAssessorSpec.js b/spec/tree/assess/TreeAssessorSpec.js index <HASH>..<HASH> 100644 --- a/spec/tree/assess/TreeAssessorSpec.js +++ b/spec/tree/assess/TreeAssessorSpec.js @@ -226,6 +226,30 @@ describe( "TreeAssessor", () => { expect( assessment ).toEqual( assessmentToGet ); } ); + + it( "return null if an assessment under the given name does not exist", () => { + const researcher = new TreeResearcher(); + const research = new TestResearch(); + researcher.addResearch( "test research", research ); + + const assessmentToGet = new TestAssessment( true, 4, "assessment to get", researcher ); + + const scoreAggregator = new TestAggregator(); + const assessments = [ + new TestAssessment( true, 8, "assessment not to get", researcher ), + assessmentToGet, + ]; + const assessor = new TreeAssessor( { + researcher, + scoreAggregator, + i18n, + assessments, + } ); + + const assessment = assessor.getAssessment( "unknown assessment" ); + + expect( assessment ).toEqual( null ); + } ); } ); describe( "setAssessments", () => {
Added test case for getting an undefined assessment.
diff --git a/src/config-wrapper.js b/src/config-wrapper.js index <HASH>..<HASH> 100644 --- a/src/config-wrapper.js +++ b/src/config-wrapper.js @@ -78,9 +78,11 @@ function wrap(func, required, ...configs) { transactionId, } = context.invocation; + const authorization = getToken(request); + const options = { headers: { - authorization: getToken(request), + ...(authorization ? { authorization } : authorization), }, };
refactor(config): conditionally set authorization header
diff --git a/openquake/hazardlib/calc/filters.py b/openquake/hazardlib/calc/filters.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/calc/filters.py +++ b/openquake/hazardlib/calc/filters.py @@ -209,7 +209,7 @@ class SourceFilter(object): if sitecol is not None and len(sitecol) < len(sitecol.complete): raise ValueError('%s is not complete!' % sitecol) self.hdf5path = hdf5path - if (hdf5path and + if hdf5path and ( config.distribution.oq_distribute in ('no', 'processpool') or config.directory.shared_dir): # store the sitecol with hdf5.File(hdf5path, 'w') as h5:
Small fix [skip CI]
diff --git a/snmp/tests/test_e2e_snmp_listener.py b/snmp/tests/test_e2e_snmp_listener.py index <HASH>..<HASH> 100644 --- a/snmp/tests/test_e2e_snmp_listener.py +++ b/snmp/tests/test_e2e_snmp_listener.py @@ -40,7 +40,9 @@ def test_e2e_snmp_listener(dd_agent_check, container_ip, autodiscovery_ready): """ snmp_device = _build_device_ip(container_ip) subnet_prefix = ".".join(container_ip.split('.')[:3]) - aggregator = dd_agent_check({'init_config': {}, 'instances': []}, rate=True) + aggregator = dd_agent_check( + {'init_config': {}, 'instances': []}, rate=True, discovery_min_instances=5, discovery_timeout=10 + ) # === network profile === common_tags = [
Add discovery_min_instances to SNMP Listener test (#<I>)
diff --git a/core-bundle/src/Resources/contao/modules/Module.php b/core-bundle/src/Resources/contao/modules/Module.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/Module.php +++ b/core-bundle/src/Resources/contao/modules/Module.php @@ -283,6 +283,12 @@ abstract class Module extends \Frontend if ($objNext !== null) { + // Hide the link if the target page is invisible + if (!$objNext->published || ($objNext->start != '' && $objNext->start > time()) || ($objNext->stop != '' && $objNext->stop < time())) + { + continue(2); + } + $strForceLang = null; $objNext->loadDetails();
[Core] Hide forward pages if they point to unpublished target pages (see #<I>)
diff --git a/ulid.go b/ulid.go index <HASH>..<HASH> 100644 --- a/ulid.go +++ b/ulid.go @@ -78,14 +78,10 @@ var ( // ErrBigTime is returned when passing a timestamp bigger than MaxTime. // Reading from the entropy source may also return an error. func New(ms uint64, entropy io.Reader) (id ULID, err error) { - if err = id.SetTime(ms); err != nil { + if err = id.SetTime(ms); err != nil || entropy == nil { return id, err } - if entropy == nil { - return id, nil - } - switch e := entropy.(type) { case *monotonic: if len(e.prev) != 0 && e.ms == ms {
Merge if clauses in New
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -130,12 +130,6 @@ func changeMapToURLValues(data map[string]interface{}) url.Values { switch val := v.(type) { case string: newUrlValues.Add(k, string(val)) - case []interface{}: - for _, element := range val { - if elementStr, ok := element.(string); ok { - newUrlValues.Add(k, elementStr) - } - } case []string: for _, element := range val { newUrlValues.Add(k, element)
Removed unnessary case for mapping url.Values
diff --git a/tests/integration/test_real_browser.py b/tests/integration/test_real_browser.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_real_browser.py +++ b/tests/integration/test_real_browser.py @@ -178,7 +178,7 @@ class IntegrationServers: self.servers = {} -def run_integration_server(): +def _run_integration_server(): """Runs integration server for interactive debugging.""" logging.basicConfig(level=logging.INFO) @@ -209,4 +209,4 @@ if __name__ == "__main__": # This module can be run in the following way: # $ python -m tests.integration.test_real_browser # from aiohttp_cors root directory. - run_integration_server() + _run_integration_server()
make run_integration_server() private
diff --git a/lib/link.js b/lib/link.js index <HASH>..<HASH> 100644 --- a/lib/link.js +++ b/lib/link.js @@ -23,7 +23,7 @@ function Link(session, handle, linkPolicy) { this.remoteHandle = undefined; this._onAttach = []; - if (!!this.policy.reattach) { + if (this.policy && this.policy.reattach) { this._timeouts = u.generateTimeouts(this.policy.reattach); } diff --git a/lib/session.js b/lib/session.js index <HASH>..<HASH> 100644 --- a/lib/session.js +++ b/lib/session.js @@ -242,10 +242,10 @@ Session.prototype._removeLink = function(link) { delete this._allocatedHandles[link.policy.options.handle]; if (link instanceof SenderLink) { debug('Removing sender link ' + link.name); - delete self._senderLinks[link.name]; + delete this._senderLinks[link.name]; } else { debug('Removing receiver link ' + link.name); - delete self._receiverLinks[link.name]; + delete this._receiverLinks[link.name]; } };
Better protection against missing policy in link for some unit-tests
diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java index <HASH>..<HASH> 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,12 @@ final class StandardGitHubRepository implements GitHubRepository { requestBody.put("labels", labels); } requestBody.put("body", body); + try { + Thread.sleep(1000); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class); return (Integer) response.getBody().get("number"); }
Try to avoid hitting secondary rate limit when opening issues GitHub employs a secondary rate limit for actions that can trigger notifications, such as opening a new issue. To avoid hitting this limit, they recommend [1] waiting at least one second between each request. This commit attempts to comply with this guidance by adding a one-second sleep prior to each POST request that opens an issue. Closes gh-<I> [1] <URL>
diff --git a/framework/views/alertDialog.js b/framework/views/alertDialog.js index <HASH>..<HASH> 100644 --- a/framework/views/alertDialog.js +++ b/framework/views/alertDialog.js @@ -144,6 +144,8 @@ limitations under the License. * Destroy alert dialog. */ destroy: function() { + this._mask.off(); + this._element.remove(); this._mask.remove(); this._deviceBackButtonHandler.destroy(); diff --git a/framework/views/popover.js b/framework/views/popover.js index <HASH>..<HASH> 100644 --- a/framework/views/popover.js +++ b/framework/views/popover.js @@ -276,6 +276,7 @@ limitations under the License. destroy: function() { this._scope.$destroy(); + this._mask.off(); this._mask.remove(); this._popover.remove(); this._element.remove();
Unbind event handlers to prevent memory leak.
diff --git a/forms/EmailField.php b/forms/EmailField.php index <HASH>..<HASH> 100644 --- a/forms/EmailField.php +++ b/forms/EmailField.php @@ -11,11 +11,12 @@ class EmailField extends TextField { } function getAttributes() { - $attrs = array( - 'type' => 'email', + return array_merge( + parent::getAttributes(), + array( + 'type' => 'email' + ) ); - - return array_merge($attrs, $this->attributes); } /**
BUGFIX Ensure merging correctly
diff --git a/extending/optimize/optimize.php b/extending/optimize/optimize.php index <HASH>..<HASH> 100644 --- a/extending/optimize/optimize.php +++ b/extending/optimize/optimize.php @@ -18,7 +18,7 @@ function rah_backup__optimize() { @$tables = getThings('SHOW TABLES'); - foreach((array) $tables as $table) { + foreach($tables as $table) { @safe_query('OPTIMIZE TABLE `'.$table.'`'); } }
getThings should always return an array.
diff --git a/lib/cucumber/cli/configuration.rb b/lib/cucumber/cli/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber/cli/configuration.rb +++ b/lib/cucumber/cli/configuration.rb @@ -136,7 +136,7 @@ module Cucumber end def tag_limits - tag_expression.limits + tag_expression.limits.to_hash end def tag_expressions
Cast tag limits to Hash because jruby
diff --git a/ghostjs-core/src/ghostjs.js b/ghostjs-core/src/ghostjs.js index <HASH>..<HASH> 100644 --- a/ghostjs-core/src/ghostjs.js +++ b/ghostjs-core/src/ghostjs.js @@ -92,6 +92,10 @@ class Ghost { page.set('viewportSize', options.viewportSize) } + page.onResourceTimeout = (url) => { + console.log('page timeout when trying to load ', url) + } + page.onPageCreated = (page) => { var pageObj = { page: page,
Log when pages timeout when loading.
diff --git a/lib/modules/apostrophe-modal/public/js/modal.js b/lib/modules/apostrophe-modal/public/js/modal.js index <HASH>..<HASH> 100644 --- a/lib/modules/apostrophe-modal/public/js/modal.js +++ b/lib/modules/apostrophe-modal/public/js/modal.js @@ -70,7 +70,7 @@ apos.define('apostrophe-modal', { // Fewer event handlers all the time = better performance apos.modalSupport.initialized = false; - $(document).off('keyup.aposModal'); + $(document).off('keydown.aposModal'); $(document).off('click.aposModal'); };
forward-ported fix for "escape fires multiple events" bug
diff --git a/packages/posts/test/02_import-all.js b/packages/posts/test/02_import-all.js index <HASH>..<HASH> 100644 --- a/packages/posts/test/02_import-all.js +++ b/packages/posts/test/02_import-all.js @@ -1 +1,5 @@ -import "../serverless/handler"; +import "../serverless/handler/getPhotos"; +import "../serverless/handler/getPosts"; +import "../serverless/handler/getWords"; +import "../serverless/handler/instagramAuthRedirect"; +import "../serverless/handler/instagramAuthReturn";
ci(posts): `import` each serverless handler instead of just the `handlers/index`. The `require`s are deferred which means they don't actually run and require all the code I want for the coverage calculations.
diff --git a/stix2validator/errors.py b/stix2validator/errors.py index <HASH>..<HASH> 100644 --- a/stix2validator/errors.py +++ b/stix2validator/errors.py @@ -212,6 +212,9 @@ def pretty_error(error, verbose=False): if ('is_family' in error.instance and not isinstance(error.instance['is_family'], bool)): msg = "is_family: 'true' is not of type 'boolean'" + elif ('is_family' in error.instance and + 'name' not in error.instance): + msg = "'name' is required when 'is_family' is true" else: raise TypeError except TypeError:
Improve an error message for malware Specifically, when 'is_family' is true but 'name' is not present.
diff --git a/tests/unit/utils/test_ssdp.py b/tests/unit/utils/test_ssdp.py index <HASH>..<HASH> 100644 --- a/tests/unit/utils/test_ssdp.py +++ b/tests/unit/utils/test_ssdp.py @@ -179,3 +179,20 @@ class SSDPFactoryTestCase(TestCase): assert ssdp.time.sleep.call_args[0][0] > 0 and ssdp.time.sleep.call_args[0][0] < 0.5 assert factory.log.debug.called assert 'Permission error' in factory.log.debug.mock_calls[0][1][0] + + def test_datagram_received_bad_signature(self): + ''' + Test datagram_received on bad signature + + :return: + ''' + factory = ssdp.SSDPFactory() + data = 'nonsense' + addr = '10.10.10.10', 'foo.suse.de' + + with patch.object(factory, 'log', MagicMock()): + factory.datagram_received(data=data, addr=addr) + assert factory.log.debug.called + assert 'Received bad signature from' in factory.log.debug.call_args[0][0] + assert factory.log.debug.call_args[0][1] == addr[0] + assert factory.log.debug.call_args[0][2] == addr[1]
Add unit test on datagram_received when bad signature is happening
diff --git a/code/model/entity/abstract.php b/code/model/entity/abstract.php index <HASH>..<HASH> 100644 --- a/code/model/entity/abstract.php +++ b/code/model/entity/abstract.php @@ -464,6 +464,15 @@ abstract class KModelEntityAbstract extends KObjectArray implements KModelEntity { $data = parent::toArray(); + foreach ($this->getComputedProperties() as $property) + { + if ($this->{$property} instanceof KModelEntityInterface) { + $data[$property] = array_values($this->{$property}->toArray()); + } else { + $data[$property] = $this->{$property}; + } + } + foreach(array_keys($data) as $key) { if (substr($key, 0, 1) === '_') {
Improve toArray() to also display all computed properties. This is an ideal behavior for displaying JSON to an JavaScript app written in for example in Ember.js / AngularJS etc.